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>
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>
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.
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.
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.
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.
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.
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.
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>
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>
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>
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>
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>
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>
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 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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
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.