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

3609 Commits

Author SHA1 Message Date
Christophe CURIS
93767d399d Re-enable the compiler check for unused arguments
Now that the code have been cleaned up on that matter, it is a good
idea to re-enable warning on these cases because they help keeping
the code as simple and maintainable as possible.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:11 -02:00
Christophe CURIS
6909ee0976 wmaker: Marked arg as unused for compiler in Timer handler
The timers proposed by WINGs toolkit are handled with a callback function,
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-11-01 15:27:10 -02:00
Christophe CURIS
066d0cdef7 WPrefs: 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-11-01 15:27:10 -02:00
Christophe CURIS
63037bf426 WPrefs: 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-11-01 15:27:10 -02:00
Christophe CURIS
bc5985e824 WPrefs: Marked args as unused for compiler in event 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-11-01 15:27:10 -02:00
Christophe CURIS
dd82c46335 WPrefs: Marked args as unused for compiler in X Error handler
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-11-01 15:27:10 -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
cd78f11abc util: 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-11-01 15:27:10 -02:00
Iain Patterson
2757713637 Avoid unnecessary wWindowConfigure().
If a window handles a ConfigureRequest which did not specify a move or
resize operation we should not call wWindowConfigure() and save the
window geometry.

Sergey Popov reported a scenario in which the old behaviour caused a bug:

* Start gvim with a server.
  "gvim --servername qwe .gimvrc"

* Maximize gvim.

* (Re)open a file in the same window
  "gvim --servername qwe --remote-silent .gvimrc"

* Now the window claims to be unmaximized and its old geometry is
  forgotten.

The bug was that when the gvim window reread the file it generated a
ConfigureRequest without specifying a geometry change but we called
wWindowConfigure() and saved its geometry as though it had been
maximized.
2013-10-24 11:52:39 -02:00
Doug Torrance
e650bf49ea Updated default icons
All the non-Window Maker-specific icons have been removed from the default
configuration in WMWindowAttributes.

In addition, the icon for drawers has been added to WMWindowAttributes.  Also,
it has been changed from a .png file to a .tiff and .xpm to bring it in line
with the other provided icons.

Update:  in the original version of this patch, I neglected to modify the
appropriate Makefile.am to account for the drawer icon changes.
2013-10-22 14:41:09 -02:00
Christophe CURIS
9f1207342a WINGs: Marked args as unused for compiler in WINGs API code
There are a few function in WING's API that take parameter for consistency
reason and for possible future evolution, but actually do not need the
argument.

As they are 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
bd58625a3f WINGs: Marked args as unused for compiler in a few more callback functions
As callback have a fixed prototype, it is 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
Christophe CURIS
ea74fe8871 WINGs: Marked args as unused for compiler in event 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-19 18:01:36 -03:00
Christophe CURIS
237c386fdc WINGs: 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-19 18:01:36 -03:00
Christophe CURIS
702764a7b0 WINGs: Marked args as unused for compiler in widget resize callback code
WINGs dispatches window resize 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-19 18:01:36 -03:00
Christophe CURIS
0d8a530bc3 WINGs: Marked args as unused for compiler in XDND callback code
The drag-n-drop mechanism is managed by WINGs through 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-19 18:01:36 -03:00
Christophe CURIS
fed1bf4de3 WINGs: 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-10-19 18:01:36 -03:00
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