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

@@ -237,10 +237,10 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
/* Try the clips */
if (name == NULL) {
for (i = 0; i < scr->workspace_count; i++)
for (i = 0; i < w_global.workspace.count; i++)
if (scr->workspaces[i]->clip == wapp->app_icon->dock)
break;
if (i < scr->workspace_count)
if (i < w_global.workspace.count)
name = scr->workspaces[i]->name;
}
/* Try the drawers */
@@ -382,7 +382,7 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state)
tmp = WMGetFromPLString(value);
if (sscanf(tmp, "%i", &state->workspace) != 1) {
state->workspace = -1;
for (i = 0; i < scr->workspace_count; i++) {
for (i = 0; i < w_global.workspace.count; i++) {
if (strcmp(scr->workspaces[i]->name, tmp) == 0) {
state->workspace = i;
break;
@@ -471,7 +471,7 @@ void wSessionRestoreState(WScreen *scr)
/* Try the clips */
if (dock == NULL) {
for (j = 0; j < scr->workspace_count; j++) {
for (j = 0; j < w_global.workspace.count; j++) {
if (strcmp(scr->workspaces[j]->name, tmp) == 0) {
dock = scr->workspaces[j]->clip;
break;
@@ -493,7 +493,7 @@ void wSessionRestoreState(WScreen *scr)
} else {
if (n == 0) {
dock = scr->dock;
} else if (n > 0 && n <= scr->workspace_count) {
} else if (n > 0 && n <= w_global.workspace.count) {
dock = scr->workspaces[n - 1]->clip;
}
}
@@ -556,6 +556,6 @@ void wSessionRestoreLastWorkspace(WScreen * scr)
/* Get the workspace number for the workspace name */
w = wGetWorkspaceNumber(scr, value);
if (w != scr->current_workspace && w < scr->workspace_count)
if (w != scr->current_workspace && w < w_global.workspace.count)
wWorkspaceChange(scr, w);
}