1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

63 Commits

Author SHA1 Message Date
John D Pell
bd38778bef Use wuserdatapath() everytime it is applicable
Replace calls to wusergnusteppath() which just append "/Library" by calls
to wuserdatapath().
Take opportunity to replace hardcoded "/WindowMaker" directories with
the existing PACKAGE_TARNAME macro (which comes from autotools).

The choice of 'TARNAME' is because it meant to be used in filename, thus
less likely to have problematic characters than PACKAGE_NAME (meant for
display purpose) and PACKAGE which is there for historical reason.
2021-08-10 09:42:43 +01:00
Christophe CURIS
d28edde23e Added some explicit conversion to double precision
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>
2015-05-24 23:25:57 +01:00
Christophe CURIS
79a95d7173 Fixed floating point constants defined as double but expected as float
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>
2015-05-24 23:25:57 +01:00
Christophe CURIS
33855a7a12 WPrefs: replaced call to external program "chmod" by the equivalent system call
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>
2014-11-23 22:42:18 +00:00
Christophe CURIS
34f35ee534 WPrefs: changed label from "msec" to the standard "ms" from the SI
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>
2014-11-23 22:42:18 +00:00
Christophe CURIS
03a7771c86 WPrefs: reorganised the Mouse Settings panel for better look
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>
2014-11-08 20:12:03 +00:00
Christophe CURIS
60d9fc5bb7 WPrefs: grouped items related to the mouse actions in a single place
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>
2014-11-08 20:12:03 +00:00
Christophe CURIS
4bb93d3dab WPrefs: replaced a few constants by the macro 'wlengthof'
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>
2014-11-02 13:13:19 +01:00
David Maciejak
0d0169a413 WPrefs: add new mouse actions configuration
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>
2014-11-02 12:50:03 +01:00
David Maciejak
51b342fee5 WPrefs: add new mouse buttons configuration support
This patch is updating the mouse button configuration panel
to be able to set action to the new mouse buttons supported.
2014-08-27 13:55:55 +01:00
Christophe CURIS
894d1c80a3 WPrefs: fix memory leak when saving settings (Coverity #50140 + #50157 + #50159)
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>
2014-06-01 20:35:06 +01:00
Christophe CURIS
dc2a991e21 WPrefs: fix possible crash when saving mouse modifier (Coverity #50098)
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>
2014-06-01 20:35:06 +01:00
David Maciejak
aa890c8868 WPrefs: Fixed compiler warnings
This patch is used to catch some return function value, to make the
compiler happy.
2014-04-24 10:47:44 +01:00
Christophe CURIS
ecfeb8bc1c WPrefs: Resized frames inside Mouse Settings panel to avoid label truncated
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>
2014-02-13 09:02:38 +00:00
Rodolfo García Peñas (kix)
4989097049 GetWindow function, argument not used
The argument "panel" in the function GetWindow() is not used.
This patch removes this argument to avoid compiler warnings.
2014-01-31 19:38:18 +00:00
Christophe CURIS
01c7390be1 WPrefs: Use the macro 'wlengthof' to get the number of element in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
ce1513f89f WPrefs: Removed unused Screen argument to the 'Init*' functions
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>
2013-11-01 15:27:11 -02:00
Christophe CURIS
66f6817966 WPrefs: Marked args as unused for compiler in Notification callback code
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>
2013-11-01 15:27:10 -02:00
Christophe CURIS
0382dd5dd7 WPrefs: Fixed empty list of Mouse Grab Modifier problem
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>
2013-06-16 18:53:05 +01:00
Christophe CURIS
5d2fb4ec97 WPrefs: Fix crash when switching to mouse settings panel
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>
2013-06-16 15:02:55 +01:00
Christophe CURIS
5a65dbeb3d WPrefs: Cleaned dangerous function prototype usage
- 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
2013-05-12 01:01:20 +01:00
Christophe CURIS
b5101fc8ae WPrefs: Added 'const' attribute to function parameters 2013-05-12 01:01:19 +01:00
Christophe CURIS
eb14bca73b WPrefs: Moved content of 'double.h' into 'WPrefs.h'
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).
2013-05-12 01:01:19 +01:00
Christophe CURIS
8238e4681a WPrefs: Move declaration of function into the common header
It is a bad idea to declare the prototype of an external function
in a file as it won't allow the compiler to cross-check it.
2013-05-11 00:17:27 +01:00
Christophe CURIS
7f6699ffca Changed formula for getting the number of elements in a static array
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
2013-05-11 00:17:27 +01:00
Rodolfo García Peñas (kix)
43c3526d21 WPrefs: XKeycodeToKeysym deprecated function
The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
2012-07-15 13:34:37 +02:00
Tobias Stoeckmann
cc30444dda No need to call memset after wmalloc
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.
2012-05-04 18:41:01 -03:00
Tamas TEVESZ
3c408fa179 Update local copy of GPLv2 and FSF address in copyrights
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 18:13:56 +02:00
Tamas TEVESZ
94a0c7b42f Fix some double newlines
Just a couple that woud now print double (or several more) newlines.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:30 +02:00
Tamas TEVESZ
1f21919809 Remove wsyserrorwithcode, rename wsyserror to werror
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>
2010-10-07 12:04:30 +02:00
Brad Jorsch
6082f2d243 Fix trivial warnings
* Format string integer size warnings
 * Missing or non-value returns in non-void functions
 * A missing #include in WPrefs.app/MouseSettings.c
2010-04-09 15:16:31 +02:00
Tamas TEVESZ
71aa4f2884 Switch file ops to stdio
- 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
2010-03-27 10:31:13 +01:00
Carlos R. Mafra
688a56e8ab Change to the linux kernel coding style
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 :-)
2009-08-20 00:59:40 +02:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +00:00
dan
4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
dan
92b012e800 patch to add binary mode on opening files (for Windows+Cygwin compatibility). 2002-09-15 20:37:41 +00:00
dan
cab71ba6a1 - Fixed text in info panel for multibyte (Seiichi SATO <ssato@sh.rim.or.jp>)
- 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
2002-01-04 07:32:37 +00:00
dan
33cc542e85 - Finished moving to the new proplist handling code in WINGs.
- 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).
2001-10-04 03:07:34 +00:00
dan
3bde6495a3 - Removed the following 3 options from configuration: SelectWindowsMouseButton,
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.
2001-04-27 23:41:17 +00:00
dan
86154ba01d A few miscelaneous fixes 2001-04-25 02:03:08 +00:00
kojima
10972f2666 adapted for SetViewExpands... 2001-02-20 23:39:06 +00:00
kojima
9d88b14f59 tomka's i18n fixes 2001-02-08 22:43:00 +00:00
kojima
f91f2eb173 changed top widget of panels from frame to box 2001-02-08 21:54:12 +00:00
dan
a20aebdef2 - Made all changes for moving WINGs headers in the WINGs subdirectory.
- Updated get-{wings|wutil}-flags accordingly
2001-01-18 19:21:56 +00:00
dan
899226207d - Fixed a flickering problem with the scrollview.
- Use of uppercase letters when getting keysyms
2000-11-16 18:07:12 +00:00
dan
2bd2b72af9 - renamed wstrappend() to wstrconcat().
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.
2000-11-01 15:40:15 +00:00
dan
497e34b6b8 - Replaced all free() with wfree() where appropriate
- Fixed some memory leaks
2000-10-31 14:57:22 +00:00
id
d220b22b81 to load None button correctly. 1999-09-29 09:47:12 +00:00
dan
0a615406df Fixed compile problems. 1999-09-20 20:07:32 +00:00
kojima
a06f09c849 fixed crash bug on mouse panel 1999-09-19 20:56:43 +00:00