When the result of the operation is expected to use double precision, this
patchs adds an explicit conversion to that type to tell the compiler that
this is what we want, and not an unexpected side effect.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
To preserve the accuracy of the operation, the C standard request that the
mathematical operation is performed using double precision, but in many
case this is not necessary so this patch fixes a few constants to avoid
that conversion.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
It is more efficient to use the dedicated function than to call an external
binary program to do the job, and it reduce the risk of problem in case the
path would end up with potentially problematic characters.
It should also close Coverity bug #50225 ("Use of untrusted string value")
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The International System of Units defines "ms" as the standard abbreviation
for milliseconds, so let's use it everywhere to be consistent.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As many option have been added to it, the panel started to look overloaded.
Content have been slightly moved to make it look nicely organised inside
the window, and with possibly less truncated text.
Took opportunity to include a visual feedback to the user, when checking
the "Disable mouse actions" box then we disable the related popup menu
buttons to reflect this.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This reduce the risk to miss something in case the array they refer to gets
updated, because with the macro the proper number of element will be
evaluated by the compiler automatically.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This patch is adding GUI configuration for new mouse actions:
-Previous Workspace
-Next Workspace
-Previous Window
-Next Window
-Switch Windows
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
As pointed by Coverity, the string returned by 'WMGetTextFieldText' is
allocated dynamically, so it must be freed when not needed anymore.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, there is a possible NULL pointer dereference in the
code that extracts the selected modifier (from a popup button list).
The code assumes that there is always a space between the core name of the
modifier (which is used for saving) and the more user friendly name. This
is true if the list could be successfully generated in fillModifierPopUp,
but it may not be the case if that function has to fall-back to the
default list (XGetModifierMaping failure).
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Some labels were truncated because the frame containing them was a bit
short; now the frames on the left have been shrunk (they had too much
margin) so the frames on the right can be expanded to have the labels fully
visible.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The functions that create the different configuration panels were taking
the screen structure as argument, but it turns out that none of them
actually need it.
We just remove the argument to make code simpler and easier to maintain.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The mechanism of Notifications in the WINGs toolkit is relying on
callbacks to dispatch notifications, which means having a fixed argument
list for the handling function.
It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original code was assuming that the Xkb extension is available
everywhere, which is not the case. This resulted in all modifiers
to be seen as NoSymbol, thus the empty list.
Now we initialize properly the Xkb extension at the start of the
program, and provide a work-around with the historical function in
the case the ext would not be available.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Apparently, there is some exceptional case when the 'Mouse Grab
Modifier' list can be empty, in which case the program would
crash.
This patch makes sure the program will not crash (that's a bad
behaviour), but does not solve the empty list case
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
- remove extern declaration in source file, use header instead
- add inclusion of header defining the functions of the file to
get the compiler to cross-check them
- marked static the functions that should not be visible ouside
their file
It is not a good idea to multiply the number of header files,
specially in this case where 'double.h' defined so few things
(and lacked the usual copyright notice / include guards).
When using the formula [sizeof(array) / sizeof( x )] to get the number
of element in a static array, it is better to use array[0] for 'x'
instead of the base type of array:
- in case the base type would change someday;
- if the compiler were deciding to insert padding somewhere
memset is the last function call in wmalloc, just before it returns the
newly allocated memory. Therefore it is not needed to call it again
after wmalloc call. Although I would prefer to switch wmalloc to a
calloc-based wcalloc function, the compatibility of WINGs for old apps
should be kept.
wsyserrorwithcode - Not used, no point either.
wsyserror->werror - qualifying "error" with a "type" hardly makes
sense if there are not at least two "type"s. There are not. Safe trip.
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
- Does away with the O_BINARY abomination
- as a byproduct, plugs an fd leak in wcolorpanel.c:fetchFile()
- sprinkle some fsync()s to files that have been written to (this
needs to be done everywhere)
+ fix brown paper bag thinko in configure.ac
for arq in `git ls-files *.c`; do
echo $arq;
indent -linux -l115 $arq;
done
The different line break at 115 columns is because
I use a widescreen monitor :-)
- Separated the font caches for normal fonts and fontsets in WINGs (they can
have the same names and collide in the cache giving unwanted results)
- Updated the years in the copyright notices
- Also tested the backward compatibility ability of the WINGs proplist code
which seems to work quite well.
Starting with this moment, Window Maker no longer needs libPropList and is
now using the better and much more robust proplist code from WINGs. Also the
WINGs based proplist code is actively maintained while the old libPropList
code is practically dead and flawed by the fact that it borrowed concepts
from the UserDefaults which conflicted with the retain/release mechanism,
making some problems that libPropList had, practically unsolvable without a
complete redesign (which can be found in the more robust WINGs code).
WindowListMouseButton and ApplicationMenuMouseButton.
- Added 4 options to the configuration file for binding workspace actions to
mouse buttons: MouseLeftButtonAction, MouseMiddleButtonAction,
MouseRightButtonAction and MouseWheelAction. They replace the above 3
removed options, but use a different semantic.
- mouse wheel action is runtime configurable now.
Read details about this in NEWS.
be sure to replace wstrappend() with wstrconcat() anywhere in your code
because a new wstrappend() function will be implemented that will have
different semantics and if your code will use the new one instead of
the old will break.