1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00
Commit Graph

3192 Commits

Author SHA1 Message Date
Christophe CURIS
58961dce72 WUtil: Removed unused argument in internal function 2013-10-19 18:01:36 -03:00
Christophe CURIS
2dd4a34961 WUtil: Marked args as unused for compiler in WUtil's API code
There is a function in WUtil's API that take a parameter for consistency
reason, but actually does not need the argument.

As it is a case we know about, this patch adds the appropriate stuff to
tell the compiler we are ok with this to avoid a false report.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-19 18:01:36 -03:00
Christophe CURIS
6dba612d58 WUtil: Marked args as unused for compiler in a callback functions
As callback have a fixed prototype, it can be 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-10-19 18:01:36 -03:00
Iain Patterson
378a59f02e Compiler food.
The code to update the "Other maximization" menu's labels was moved from
makeMaximizeMenu() to updateMaximizeMenu(), making the WMenuEntry
pointer in the former function redundant.
2013-10-19 14:10:25 -03:00
Rodolfo García Peñas (kix)
102e836e8e Included compile file in gitignore
The compile file (in the root folder) is created by autotools for
compilers that don't support '-c -o' options.
2013-10-19 09:49:09 -03:00
Iain Patterson
783d4b9de7 Update other window menu shortcut labels.
Ensure that keyboard shortcut labels for other entries in the window
menu are updated if the user changes the shortcut.  Previously they were
only set when the menu was created and could get out of sync.
2013-10-19 09:48:58 -03:00
Iain Patterson
82dcc944c2 Update shortcut labels for Other maximization submenu.
The shortcut labels for items in the "Other maximization" menu were set
at startup and not updated if the user changed the shortcut key.  Thus
the labels shown could be wrong.  They might even be missing if no
shortcut was assigned at startup but was subsequently set during the
session.

We now ensure that the shortcut labels are updated with the menu
whenever preferences are reloaded.
2013-10-19 09:48:58 -03:00
Iain Patterson
766e8ad575 Update shortcut label for Unmaximize menu entry.
The window menu Unmaximize entry had the Maximize shortcut key as its
label.  That's because the Maximize and Unmaximize menu options are in
fact the same single entry with different text depending on the window's
state.

It can, however, cause confusion if a window is maximized using one
of the "Other maximization" options such as Maximus.  Selecting the
Unmaximize entry from the window menu would indeed unmaximize the window
but pressing the listed shortcut key would not.

We now dynamically update the shortcut label so that it shows a key
which will actually unmaximize the window.  Thus the menu description
and shortcut action are now consistent.
2013-10-19 09:48:58 -03:00
Iain Patterson
df7fb014e5 Focus fullscreen windows.
Windows which enter fullscreen mode were not automatically given focus.
Usually that didn't matter because they already had focus when they
switched modes.  An example of unexpected behaviour is opening a media
file in an already-running vlc from the commandline or via a file manager.
vlc would fullscreen mode but the launching application would retain focus.

Note that if vlc were not already running and it was launched as
described above, it would receive focus when it was opened and thus
retain focus going into fullscreen.

We now track which window had focus before a window enters fullscreen
mode and focus the original window afterwards.  In the (usual) case
where the window going fullscreen already had focus, nothing changes.
In the rarer case where the window going fullscreen didn't
have focus, it will gain focus temporarily then yield to the originally
focussed window when it leaves fullscreen mode.

To reproduce:

  * Launch vlc and configure it to switch to fullscreen when playing a
movie and to disallow multiple instances.

  * Switch to a terminal and type 'vlc /media/funny_cats.mp4' or use a
file manager to open funny_cats.mp4 with vlc.

  * Press space to pause the movie.  Nothing happens because the
terminal/file manager still has focus.
2013-10-17 18:11:00 +01:00
Doug Torrance
86fbf8baaa Add "Other maximization options" to window menu.
There are a number of window maximization options which are currently
only available to the user via keyboard shortcut:
     * maximize vertically/horizontally
     * maximize left/right/top/bottom half
     * maximize left top/right top/left bottom/right bottom corner
     * maximus

In this patch, they become available through the window menu, under
the "Other maximization options" submenu.
2013-10-15 23:03:53 +01:00
Christophe CURIS
3ba54ed0d6 wmaker: Marked args as unused for compiler in signal handlers
When the process receive a signal, a callback function is used, which
means having a fixed argument list for that application function.

It is then correct to not use the argument, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:03:24 +01:00
Christophe CURIS
7c02d5f1c5 wmaker: Marked args as unused for compiler in process death handlers
When a sub-process terminate, the function to process that event is
defined using a callback mechanism, which means having a fixed argument
list for that application 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-10-13 23:03:23 +01:00
Christophe CURIS
bd77216edf wmaker: Removed explicit callback type conversion
It is dangerous to use a function that does not use the same prototype as
expected by the callback, because that mean there is conversion performed
for the arguments, on which the compiler has no possibility to report
problems.

It is safer to create the function with the strict argument list, and
insert an  explicit type conversion for which the compiler will be able
to perform compatibility checks, and include optional code when needed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:03:23 +01:00
Christophe CURIS
298343f5ad wmaker: Marked args as unused for compiler in X Error handlers
When an error occurs in X, the Xlib is using a callback mechanism to
execute application code to handle the problem, which means having a
fixed argument list for that application 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-10-13 23:03:23 +01:00
Christophe CURIS
f0b8be0aed wmaker: Marked args as unused for compiler in WINGs callback code
The WINGs toolkit dispatch events on widgets using callbacks, 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-10-13 23:03:23 +01:00
Christophe CURIS
6948a9f2fe wmaker: Removed explicit callback type conversion
It is dangerous to use a function that does not use the same prototype as
expected by the callback, because that mean there is conversion performed
for the arguments, on which the compiler has no possibility to report
problems.

It is safer to create the function with the strict argument list, and
insert an  explicit type conversion for which the compiler will be able
to perform compatibility checks, and include optional code when needed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:00:19 +01:00
Christophe CURIS
fd10d4069f wmaker: Marked args as unused for compiler in WINGs Notif 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-10-13 23:00:19 +01:00
Christophe CURIS
f45d57ff16 wmaker: Marked args as unused for compiler in XCloseEvent callback code
The toolkit dispatches window close request events using callback
functions, which means having a fixed argument list for that 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-10-13 23:00:19 +01:00
Christophe CURIS
3857def779 wmaker: Marked args as unused for compiler in XClickEvent callback code
The toolkit dispatches X events for MouseButton using callback functions,
which means having a fixed argument list for that 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-10-13 23:00:19 +01:00
Christophe CURIS
c34a55ed5a wmaker: Marked args as unused for compiler in XExposeEvent callback code
The custom drawing code for windows is handled using callback functions,
which means having a fixed argument list for that 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-10-13 23:00:19 +01:00
Christophe CURIS
9330ddf946 wmaker: Marked args as unused for compiler in menu callback code
When an entry of a menu is selected, the appropriate action is triggered
using a callback, which means having a fixed argument list for that
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-10-13 23:00:19 +01:00
Christophe CURIS
adb936e9f2 wmaker: Marked args as unused for compiler in callback code
To have an easy-to-maintain code, the configuration loading function is
using a lot off callbacks, which means having a fixed argument list.

It is then correct to not use all of them in all case, so this patch adds
the appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:00:19 +01:00
Christophe CURIS
0118906a85 wmaker: Marked args as unused at places where conditional code is used
There are a few cases in the code where conditional compiling can
lead, when the corresponding block is not activated, to some arguments
not being used.

This patch adds the proper stuff to avoid a false report from the
compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:00:18 +01:00
Christophe CURIS
30fd8a1f75 wmaker: Marked arg as unused for compiler in callback code
As a callback function has a fixed prototype, it is not an error to have
some arguments unused, but we need to let the compiler about it to avoid
spurious messages that would hide real cases.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 21:38:42 +01:00
Christophe CURIS
1b2f3c0431 wmaker: Removed non necessary macro for buffer size
The C language provides the macro 'sizeof' to handle this kind of
situation, so do not create locally a macro which can become a source
of problems.

Took opportunity to change the size of buffer to follow guidelines
from Inotify's manpage, and to remove the initial value that is useless.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 21:38:42 +01:00
Christophe CURIS
bec778aae2 wmaker: Added reset of file handle variable to avoid multiple file close
If the triggering condition occurred, the file handle for Inotify were
closed, but as the variable containing the handle was not updated it
could lead to multiple call to file close, which behaviour may be
problematic.

The file handle was passed as a parameter, which does not allow for a
clean value change, so now we use the variable directly as it is
available in the global namespace.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 21:38:42 +01:00
Christophe CURIS
a3264184bd Removed parameters to function 'handle_inotify_events' that were not used 2013-10-13 15:30:56 +01:00
Christophe CURIS
821bacb5f4 Removed parameter to function 'handleDeadProcess' that was not used 2013-10-13 15:30:56 +01:00
Christophe CURIS
3cf4ba91aa Removed parameter to function 'updateResistance' that was not used 2013-10-13 15:30:56 +01:00
Christophe CURIS
0717a0f07e Removed parameters to function 'open_window_menu_core' that were not used 2013-10-13 15:30:56 +01:00
Christophe CURIS
c42d6822de Removed parameter to function 'create_tab_icon_workspace' that was not used 2013-10-13 15:30:56 +01:00
Christophe CURIS
4dadc83a4c wmaker: Added 'static' attribute to local variables
This code is probably never compiled, but that's not a reason to
leave it incorrect.
2013-10-12 15:57:21 +01:00
Christophe CURIS
ad2b5f0ec9 wmaker: Fixed compilation of XDND support
The XDND support is not enabled by default, and not simple to
enable (does not use the appropriate configure flag method).

With previous global namespace related patches, this file not being
enabled a change was missed. Now at least it compiles, although it
is still an experimental feature.
2013-10-12 15:57:21 +01:00
Christophe CURIS
1003f89dc0 WPrefs: Fixed duplicate 'const' keyword
(as reported by LLVM / clang)
2013-10-12 15:57:21 +01:00
Christophe CURIS
6b1b6bc02e WPrefs: Grouped config key and user display icon in a single struct
Instead of defining 2 separate data arrays, use a array of struct
to make it less bug prone (no dependancy on order of elements).

Took opportunity to de-CamelCase the variable name;
Took opportunity to add appropriate const qualifier.
2013-10-12 15:57:21 +01:00
Christophe CURIS
a01c1fcb79 WPrefs: Grouped config key and user display string in a single struct
Instead of defining 2 separate data arrays, use a array of struct
to make it less bug prone (no dependancy on order of elements).

Took opportunity to de-CamelCase the variable name;
Took opportunity to add appropriate const qualifier.
2013-10-12 15:57:21 +01:00
Christophe CURIS
85cef4e2d9 util: Fixed possible off-by-one issue when generating filename
(as reported by LLVM / clang)
2013-10-12 15:57:21 +01:00
Christophe CURIS
5a16cb8e02 Removed unused WScreen argument in some Default handling functions 2013-10-12 15:18:06 +01:00
Christophe CURIS
f3e3ddf4f2 Removed unused WScreen argument in dock's clip function 2013-10-12 15:18:06 +01:00
Christophe CURIS
b7ae1b50e2 Removed unused WScreen argument in dock's drawer state functions
It was used to access the session state, which was stored in the
screen scruct, which is now more logically in the global namespace.
2013-10-12 15:18:06 +01:00
Christophe CURIS
6ad22c8672 Removed unused WScreen argument in Pixmap function 2013-10-12 15:18:06 +01:00
Christophe CURIS
803eb68fc4 Removed unused WScreen argument from workspace's state functions
Now that the workspace are not more attached to a screen, the
parameter is not needed anymore.
2013-10-12 15:18:05 +01:00
Christophe CURIS
fd869154c6 Removed unused WScreen argument from dock's clip state functions
Now that the workspace are not more attached to a screen, the
parameter is not needed anymore.
2013-10-12 15:18:05 +01:00
Rodolfo García Peñas (kix)
9c6e71ead0 Removed unused WScreen argument
The argument WScreen was not longer used, so can be removed.
2013-10-12 15:16:03 +01:00
Christophe CURIS
3b85fca43c configure: Added compilation check for dangerous use of 'extern' keyword 2013-10-11 21:58:32 +01:00
Christophe CURIS
18059fb1c7 wmaker: Moved definition of global variable 'wKeyBindings' to header
Multiple declaration of global variables in local source files is
a dangerous idea.
2013-10-11 21:58:14 +01:00
Christophe CURIS
d9832e578f wmaker: Moved global domain definition to the global namespace
The default domains were originally defined in different global
variables in C files; This patches groups them in a single
structure placed in global namespace.
2013-10-11 21:58:14 +01:00
Christophe CURIS
f751cc6a50 wmaker: Moved variable ValidModMask into the global namespace 2013-10-11 21:58:14 +01:00
Christophe CURIS
24ce829f7f wmaker: Removed global variable 'WDelayedActionSet' and associated dead code
The variable's value was set to 0 but never changed afterwards, so
the function using it would never do anything.
2013-10-11 21:58:14 +01:00
Christophe CURIS
a79c0e76d0 wmaker: Moved variables for Inotify into the global namespace 2013-10-11 21:58:13 +01:00