1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

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.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-10-08 00:56:30 +02:00
committed by Carlos R. Mafra
parent f60e65001b
commit 9e103a46e9
13 changed files with 87 additions and 87 deletions

View File

@@ -842,13 +842,13 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
changed = True;
data->rubCount = 0;
} else if (scr->current_workspace == 0 && wPreferences.ws_cycle) {
crossWorkspace(scr, wwin, opaqueMove, scr->workspace_count - 1, True);
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.count - 1, True);
changed = True;
data->rubCount = 0;
}
} else if (data->mouseX >= scr->scr_width - 2) {
if (scr->current_workspace == scr->workspace_count - 1) {
if (wPreferences.ws_cycle || scr->workspace_count == MAX_WORKSPACES) {
if (scr->current_workspace == w_global.workspace.count - 1) {
if (wPreferences.ws_cycle || w_global.workspace.count == MAX_WORKSPACES) {
crossWorkspace(scr, wwin, opaqueMove, 0, False);
changed = True;
data->rubCount = 0;
@@ -876,7 +876,7 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
changed = True;
data->rubCount = 0;
}
} else if (scr->current_workspace < scr->workspace_count) {
} else if (scr->current_workspace < w_global.workspace.count) {
/* go to next workspace */
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
changed = True;
@@ -1388,13 +1388,13 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
if (wPreferences.ws_cycle) {
if (src_x + off_x + ww < 20) {
if (!scr->current_workspace)
wWorkspaceChange(scr, scr->workspace_count - 1);
wWorkspaceChange(scr, w_global.workspace.count - 1);
else
wWorkspaceChange(scr, scr->current_workspace - 1);
off_x += scr_width;
} else if (src_x + off_x + 20 > scr_width) {
if (scr->current_workspace == scr->workspace_count - 1)
if (scr->current_workspace == w_global.workspace.count - 1)
wWorkspaceChange(scr, 0);
else
wWorkspaceChange(scr, scr->current_workspace + 1);