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 variable workspaces, that contains the list of workspaces
is moved to the global workspace properties.
Now the screen is not needed to know the workspaces.
The function getWindowState() doesn't need the WScreen argument.
The variable current_workspace, that contains the current workspace
is moved to the global workspace properties.
Now the screen is not needed to know the workspace_count.
The variable last_workspace, that contains the last used workspace
is moved to the global workspace properties.
Now the screen is not needed to know the workspace_count.
The variable name is changed to workspace.last_used because a similar
variable name is also in the WApplication struct.
The variable workspace_count, that contains the number of workspaces
is moved to the global workspace properties.
Now the screen is not needed to know the workspace_count.
As the cursor choice for each action is actually a user choice,
it is logical to put this into the structure, instead of a poorly
defined 'extern' in every file.
It is bad practice to define the prototype of an external function
inside a source file that wants to use it.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The file switchmenu.h includes the function prototypes for switchmenu.c.
The prototypes included were moved from funcs.h.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
The file winmenu.h includes the function prototypes for winmenu.c.
The prototypes included were moved from funcs.h.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
The file event.h includes the function prototypes for event.c.
The prototypes included were moved from funcs.h.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
The file cycling.h includes the function prototypes for cycling.c.
The prototypes included were moved from funcs.h.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
new window positions top left, top right, bottom left and bottom right
these new maximized positions are combinations of left, right, top and
bottom maximized positions
- 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
Added new keyboard shortcuts for moving windows between workspaces.
MoveToWorkspace1Key moves the active window directly to workspace 1.
Similarly for MoveToWorkspace2Key through MoveToWorkspace10Key.
MoveToNextWorkspaceKey moves the window to the next workspace,
MoveToPrevWorkspaceKey moves the window to the previous workspace.
Both keys respect the ws_advance and ws_cycle preferences.
MoveToNextWorkspaceLayerKey moves the window ten workspaces "forward" if
possible.
MoveToPrevWorkspaceLayerKey moves the window ten workspaces "back" if
possible.
The new shutdown.h file includes the shutdown modes and the functions
to shutdown Window Maker.
The function definitios were moved from funcs.h and the struct WShutdownMode
from WindowMaker.h.
Now, externs are not needed, only include shutdown.h
This patch moves the XRANDR variable definitions to screen.h, because
xrandr is related to screen behavior. Then, the definition externs
can be removed.
This patch also changes (in event.c) the ConfigureNotify event processing
to avoid call the "if" block if XRANDR is not enabled. I chose the option of
move the if into the HAVE_XRANDR block instead of include the
ConfigureNotify case inside of the HAVE_XRANDR block (proposed by
BALATON Zoltan) to avoid call the default option if not needed.
The functions related to colormap are moved from funcs.h to the new
file colormap.h. These files are included where needed.
The functions wColormapInstallRoot and wColormapUninstallRoot are
removed, because they are not used.
The functions of main.c should be included in main.h, not in funcs.h.
This patch adds the main.h file and moves the function prototypes to
this file.
The not needed "include funcs.h" are removed.
The contents of the rootmenu.h file are not used and can be removed,
but the prototypes of rootmenu.c are in funcs.h and should be moved
to the correct (rootmenu.h) file.
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.
Avoid some pitfalls with window maximization and make it behave more
intuitively. We now treat a window's vertical and horizontal
maximization as separate properties and only remember its original
geometry in a particular direction when it actually changes. We also
deliberately do not remember a window's geometry when it changes from
one maximized state to another. As a result windows can be more
reliably restored to their original size.
For example the "Maximize active window" hotkey followed by the
"Maximize active window vertically" hotkey will now result in the window
being maximized horizontally only, whereas previously the second hotkey
would have no effect because the window was already maximized
vertically. In addition selecting the Unmaximize window menu in the
same example will now result in the window being restored to its
original size. Previously the unmaximize attempt would have no effect
because the vertical maximization would have remembered the window's
"original" geometry when it was fully maximized.
Maximus is handled separately. The "Maximus" hotkey will now toggle
Maximus mode regardless of the window's current maximization state. For
example if two unmaximized windows are on screen and one is Maximusized
it will fill the space left by the second window, as before. But if the
first window is maximized and the "Maximus" hotkey is pressed the window
will now fill the same space as if it were Maximusized from its original
size. Previously the window would not change size from its fully
maximized state because the Maximus algorithm would consider
fully-maximized to be a valid Maximus size.
Use the WindowRelaunchKey shortcut to examine the WM_COMMAND property of
the active application's main window and launch a new instance of the
application using the retrieved command line.
When the mouse passes over the clip, wmaker would display a "odd" balloon
text with the workspace name, but the balloon itself was covered by the
clip icon!
So if the workspace name was short enough ("Internet" is, by my testing here)
the user wouldn't see anything, the balloon is completely under the clip icon.
I found this issue because one of my workspaces is called "Beyonder" and I
noticed a small "r" under the clip one day.
Instead of trying to fix this, I just removed the whole thing about displaying
the balloon because it is superfluous and I haven't seen any bug reports about
this yet, so it probably means most people are not even aware of it.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>