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