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

187 Commits

Author SHA1 Message Date
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
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
f751cc6a50 wmaker: Moved variable ValidModMask into the global namespace 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
Christophe CURIS
6dcfdd072b wmaker: Moved variables for the XRandR extension into the global namespace 2013-10-11 21:58:13 +01:00
Christophe CURIS
3995130b79 wmaker: Moved variables for the Xkb extension into the global namespace 2013-10-11 21:58:13 +01:00
Christophe CURIS
81aa311c42 wmaker: Moved variables for the XShape extension into the global namespace 2013-10-11 21:58:13 +01:00
Christophe CURIS
b6423a7b4f wmaker: Moved variable Screen Count into the global namespace 2013-10-10 20:05:26 +01:00
Rodolfo García Peñas (kix)
0de3e590ce shortcutWindows moved to w_global
The variable shortcutWindows is moved to w_global. Now, the shortcuts
are used in whole Window Maker, not only in the current screen.
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
f0c5073600 Array of workspaces moved to the workspace object in the global namespace
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.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
c610b8d7ce Variable current_workspace moved to workspace object in global namespace
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.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
e5ae684d02 Variable last_workspace moved to workspace object in global namespace
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.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
9e103a46e9 Variable workspace_count moved to the workspace object in the global namespace
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.
2013-10-09 13:02:44 +01:00
Christophe CURIS
45bfc1d1c5 wmaker: Removed variable for X Context that is not used 2013-09-30 00:53:10 +02:00
Christophe CURIS
ec91b9f68e wmaker: Moved definition of X Contexts into the global variables structure 2013-09-30 00:53:10 +02:00
Christophe CURIS
e2ce62eb5b wmaker: Moved definition of WMaker-specific XAtoms into the global variables structure 2013-09-30 00:53:10 +02:00
Christophe CURIS
379f7022bd wmaker: Moved definition of GNUStep-related XAtoms into the global variables structure 2013-09-30 00:53:10 +02:00
Christophe CURIS
ecfb2dc902 wmaker: Moved definition of WM-related XAtoms into the global variables structure 2013-09-30 00:53:10 +02:00
Christophe CURIS
b48b3370e2 wmaker: Moved global var with list of cursors to the preferences variable
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.
2013-09-30 00:53:10 +02:00
Christophe CURIS
2c20413831 wmaker: Moved timestamp variable (#2) to the global variable structure 2013-09-29 16:31:49 +01:00
Christophe CURIS
af6c4ec37f wmaker: Moved timestamp variable (#1) to the global variable structure 2013-09-29 16:31:49 +01:00
Christophe CURIS
496cb58cea wmaker: Moved function prototype to the appropriate header
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>
2013-06-30 15:10:09 +01:00
Christophe CURIS
74cd836e48 wmaker: Replaced local 'extern' definition of wPreferences by proper header usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-30 15:10:09 +01:00
Christophe CURIS
6dda67bc51 wmaker: Added attribute 'noreturn' to appropriate functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-09 18:46:56 +01:00
Rodolfo García Peñas (kix)
ed80a9bf5c New header file switchmenu.h
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>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
9ededf6cb2 New header file winmenu.h
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>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
157209a035 New header file event.h
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>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
583235bb36 New header file cycling.h
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>
2013-05-26 19:48:00 +01:00
Renan Traba
3eb01800e8 added new windows positions
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
2013-05-21 11:24:36 +01:00
Renan Traba
d025625df0 added new maximize positions, top and bottom
these new positions are equal to left and right,
but they are at top and bottom half of screen
2013-05-21 11:24:35 +01:00
Christophe CURIS
d517d5cac0 wmaker: 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
a3281b1e89 src/main.c: Moved local prototype for global function to header 'funcs.h'
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-12 01:01:19 +01:00
Rodolfo García Peñas (kix)
41da1b30db New file misc.h
This is the new file misc.h, with the function prototypes for misc.c.
This file is created using misc.c and removing the prototypes from funcs.h
2013-04-17 10:13:25 +01:00
Rodolfo García Peñas (kix)
052efedd93 Removed dup function wScreenSearchForRootWindow
The function wScreenSearchForRootWindow is exactly like wScreenForRootWindow
so can be removed swapping the function call.
2013-04-03 19:20:10 +01:00
Iain Patterson
ae7235c2df Shortcuts for moving windows between workspaces.
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.
2013-03-28 19:03:33 +00:00
Iain Patterson
63219247c6 Added shortcut to switch to last used workspace.
Added new LastWorkspaceKey shortcut and Workspaces menu entry to switch back to
the last used workspace.
2013-03-28 18:57:40 +00:00
Rodolfo García Peñas (kix)
68208a01a0 New shutdown.h file
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
2013-01-12 14:37:31 +00:00
Rodolfo García Peñas (kix)
b71f2c30fd Removed XRANDR externs
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.
2013-01-12 13:10:29 +00:00
Rodolfo García Peñas (kix)
02feb72fdc New colormap header file and remove unused functions
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.
2012-06-25 23:49:10 +01:00
Rodolfo García Peñas (kix)
6bdc1318c1 Moving header functions to main.h
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.
2012-06-24 12:32:36 +01:00
Rodolfo García Peñas (kix)
da4e4128b3 rootmenu header file updated
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.
2012-06-24 12:30:17 +01: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
Iain Patterson
aee0ad45f2 More intuitive maximization handling.
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.
2012-05-04 18:39:21 -03:00
Tobias Stoeckmann
2755b1e45d Use proper (w)free functions for (w)malloced data. 2012-05-04 18:39:21 -03:00
Iain Patterson
8352c9ef60 Allow relaunch with shortcut key.
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.
2012-04-04 12:12:12 +01:00
Carlos R. Mafra
4954d4df23 clip: Do not display balloon with workspace name
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>
2012-02-12 20:04:13 +00:00
Carlos R. Mafra
31b5ee1a5f event.c: Make two functions static
Saves 120 bytes:

[mafra@Pilar:wmaker.git]$ size src/event.o*
   text    data     bss     dec     hex filename
  12568       0    1068   13636    3544 src/event.o.new
  12688       0    1068   13756    35bc src/event.o.old
2012-01-28 14:48:29 +00:00