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

3192 Commits

Author SHA1 Message Date
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
c3c2d8d7f1 wmaker: Moved variable Ignore Wks Change into the workspace object in the global namespace
Took the opportunity to change its type: it was an integer, but it is
actually holding a yes/no status, so it is now defined as a boolean.
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)
6d65daf1be Removed unused keymove_tick variable
The variable keymove_tick is set, but is never used after, so can
be removed.

kix@osaka:~/src/wmaker/git/wmaker-crm/src$ grep keymove_tick *[ch]
moveres.c:                      scr->keymove_tick = 0;
screen.h:    int keymove_tick;
kix@osaka:~/src/wmaker/git/wmaker-crm/src$

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-10 19:09:22 +01:00
Rodolfo García Peñas (kix)
97ecb7b613 Compiler food.
This patch set the variable aicon to NULL, to avoid compiler warnings.

This patch also adds some code style.
2013-10-09 23:57:51 +01:00
Daniel Déchelotte
f53797f9ef Remove dead code for a confirmation dialog that we'll probably never want to show
Setting a clip as autoattracting will disable an autoattracting drawer,
and reciprocally. Although not immediately obvious, it should be fairly
easy to figure out, and is totally reversible. So we'll probably never
opt to show that confirmation dialog box.
2013-10-09 13:26:09 +01:00
Daniel Déchelotte
45799efa02 Fix removal of drawer with a single appicon
When removing a drawer containing a single appicon, the latter is
docked where the drawer was, instead of being totally undocked.
2013-10-09 13:22:37 +01:00
Daniel Déchelotte
bf6bc79d37 Fix stacking level bug when creating a drawer in a keep-on-top dock
Now moving the drawer's window to the WMDockLevel if it's on top (i.e., not lowered)
(Minor bug, as it didn't persist after a WM restart)
2013-10-09 13:21:51 +01:00
Daniel Déchelotte
36cd5e6641 Correctly initialize the drawer tile when the dock is on the left side 2013-10-09 13:21:21 +01:00
Daniel Déchelotte
40231016f9 Prevent crash when toggling auto-attract on a drawer with clip disabled
toggleAutoAttractCallback needs to check whether there are clips before iterating
through them (or it crashes WM!). The extra test is needed because now drawers can
auto-attract as well. Before drawers, only clips could auto-attract, so testing
wPreferences.flags.noclip was pointless.
2013-10-09 13:21:07 +01:00
Daniel Déchelotte
4d74b18987 Allow undocking appicon when Alt is pressed
When moving an undocked appicon (or applet), allow it to
be docked even if Alt is still pressed

That conforms to pre-9fae35fbc4 behavior.
2013-10-09 13:08:44 +01:00
Rodolfo García Peñas (kix)
2e64831fb6 Removed unused variable wapp_list
The variable wapp_list is never set, then the comparison with
wapp is only true if wapp is NULL. wapp can not be NULL in the
function wApplicationDestroy() because is tested previously.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:45 +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)
6987d4aa40 Removed WScreen argument
The argument WScreen is removed in the functions
wSessionClearState() and getWindowState()

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
40e1ea08b8 Varible session_state moved to global namespace
The variable session_state, defined in screen.h (WScreen), is moved to
the global variable w_global.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas
d27ce03780 Remove warning by open coding WM_ITERATE_ARRAY macro
This patch gets rid of the warning:

switchpanel.c: In function 'wSwitchPanelSelectFirst':
switchpanel.c:673:18: warning: variable 'tmpwin' set but not used [-Wunused-but-set-variable]

by using the body of the WM_ITERATE_ARRAY directly and avoiding the temporary
variable 'tmpwin' which ends up being used only on the LHS inside the macro.
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
014bc52531 wClipIconPaint appicon argument removed
Because the wClipIconPaint() function is specific to paint the clip,
it knows where is the clip (wks_info.clip_icon), so the argument is not
needed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
2103fe390b Variable clip_icon moved to clip object in the global namespace
The variable clip_icon, that contains the Clip appicon
is moved to the global clip properties.

Now the screen is not needed to know the clip_icon.
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
29ac626494 Removed unused WScreen variable in wIsADrawer
The function wIsADrawer() doesn't use the argument WScreen, so can
be removed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
4a7daf2322 AppIcon list moved out of WScreen
The appicon list is moved out of WScreen. The reason is because
the appicon list is used to create and remove icons (appicons, dock,
clip,...) on the screen, but these icons are not associated with the
WScreen. These icons are associated with the Workspace.

If we check the WWorkspace struct we can see that the Clip is inside
this struct. The dock, the background, the workspace name are other
items related to the Workspace, not with the screen.

So, we should take out the appicon from the WScreen. But, what is the
better place to hold it? The workspace? NO!, because the icon list
is common to the all workspaces. Probably the better place is hold
as independent list in the global namespace, so this is my option.

In the next patches we can see that this is the better option, because
we can create the icons, without think where we should paint them.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
074092f319 Removed WScreen args not used
The WScreen arguments in the functions wWorkspaceMenuUpdate() and
makeMakeShortcutMenu() is not used now, so can be removed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
e86b8dcb2f Clip, Dock and Drawers menu moved to appropriate global namespace
The clip, dock, workspaces and drawers menus are common for all
workspaces, so they should be included in the global namespace
instead of the screen struct.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
9c252988f8 Variable workspace_menu moved to workspace object in global namespace
The variable workspace_menu, that contains the workspace_menu
is moved to the global workspace properties.

Now the screen is not needed to know the workspace_menu.

This variable is moved to the global workspace struct because it is
related to the workspace system, and not to the screen.
2013-10-09 13:02:44 +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
Rodolfo García Peñas (kix)
f60e65001b Moved 'workspace_name_font' from the Screen to a Workspace object in the global namespace
The new workspace struct includes the global information
for the workspaces. All information related with the workspaces
should be included here.

The first variable moved is workspace_name_font, included in this
patch. This variable was included in the screen info, but the
screen and the font used in the workspace name don't have any
relationship.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
4ac65ab260 wmaker: code style
This patch removes some extra curly brackets, some empty lines,
extra spaces, ... to follow wmaker's coding style
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
29ccfbbf20 Avoid loop in keybinding check
This patch changes the keybinding check in cycling keyrelease.

Now, the variable binding contains the keypressed, so we can
check if the key pressed is the same than the keybinding. If
the keybinding is different (user press other key) then finish.

Without the loop, the code is faster.

Then, the keybinding variable is not used anymore, and can be removed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-05 01:29:41 +02:00
Rodolfo García Peñas (kix)
1d09b9fdcd StartWindozeCycle uses ease variable
The function StartWindozeCycle() uses now the variable WShortKey
to store the shortcut key.

The code is the same, but now the hasModifier variable is calculated
in only one place.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-05 01:29:41 +02:00
Iain Patterson
e0697c9162 Fixed scoping error in wSwitchPanelSelectFirst().
We were using wwin as the temporary variable in WM_ITERATE_ARRAY() but
wwin was already set to the result of WMGetFromArray() and was due to be
returned from the function.  As a result of this oversight, wwin was
always set to NULL.

The bug could cause a problem in the - admittedly rare - case where all
windows were minimised at startup, causing the first invocation of the
switchpanel to highlight the first minimised window but then fail to
raise it.

Reported by Yury Tarasievich.
2013-10-02 12:23:28 +02:00
Rodolfo García Peñas (kix)
6366aeef3a wIconChangeImageFile removed error variable
This patch removes the error variable, because is not changed
after their initialization.

This patch also removes the if check to wfree the path variable,
because this variable never is NULL.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Rodolfo García Peñas (kix)
cc01ca5c6b wIconChangeImageFile get image block swapped
This patch swaps the if and the else blocks for the
image value. Now, if the image doesn't exist, and because
error is always "0" (is not changed after the definition),
we can exist from the wIconChangeImageFile function.

Before this patch, if the image was NULL, the error variable
was set to "1", so we must return !error, then return "0".

Because the "path" variable is not NULL, we must wfree it.

Now, the "Set the new image" block is moved out the if block.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Rodolfo García Peñas (kix)
3250144b94 wIconChangeImageFile find image if block swapped
This patch swaps the "if (path)" block to "if (!path)"
therefore, the true block is now "error = 1" and the
false block is the call to get_rimage_from_file function.

The second change is that the "error = 1" statement is
changed to "return 0", because if "error" is "1", then
only the "return !error" statement is used, then we can
change it for "return !1" that is "return 0".

Then, we can move the get_rimage_from_file call out of the
if block.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Rodolfo García Peñas (kix)
d6fe27af15 wIconChangeImageFile returns int
The function wIconChangeImageFile now returns an integer value
instead of boolean.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02: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
32cebb1305 wmaker: Removed notion of 'Default' mouse cursor
A default cursor would make sense if we were talking about an API,
where we would propose a 'I-don't-know' choice to devs, but here
we're talking about WindowMaker's internal, where we're supposed
to provide a consistent interface to the user, so picking a
cursor is not an option (and 'Normal' is actually a decent
looking choice anyway).

Suggested-by: Rodolfo García Peñas <kix@kix.es>
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
577506cbd2 wmaker: Moved the variable for Locale choice (I18N) to the global variable structure 2013-09-29 16:31:49 +01:00
Christophe CURIS
3892f3220a wmaker: Created a global structure to regroup all global variables
Having all the global variables at the same place will provide
better visibility on the code; grouping them in a structure
reduces the risk for name clash; it also offer the possibility
to organise them.

Another BIG benefit is that, when reading the code, an access to
a global variable will now be clearly visible, and distinguished
from a local variable use.
2013-09-29 16:31:49 +01:00
Christophe CURIS
70c6494c46 wmaker: Changed name of parameter in macro WCHECK_STATE
The name will be a problem with next change because it uses a too
common word which will be useful at a better place.
Took the opportunity to rewitre the check in the human logical
thinking order to make it easier to read.
2013-09-29 16:31:49 +01:00