From: "Rodolfo García Peñas (kix)" <[email protected]>
This patch removes the icon Creation in wWorkspaceNew. Then, the icon
creation is done in the function where wWorkspaceNew() is called.
wWorkspaceNew() is used in three functions:
- wWorkspaceMake: Used to create multiple workspaces.
- create_new_workspace: Used to add a new (last) workspace.
- wWorkspaceRestoreState: Used to restore the workspace.
The icon creation mustn't be done at wWorkspaceRestoreState, so
this function doesn't create the icon.
---
src/workspace.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/src/workspace.c b/src/workspace.c
index 8164ed2..d27eb5b 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -80,10 +80,18 @@ static void make_keys(void)
dClip = WMCreatePLString("Clip");
}
-void wWorkspaceMake(WScreen * scr, int count)
+void wWorkspaceMake(WScreen *scr, int count)
{
+ int ws;
+
while (count > 0) {
- wWorkspaceNew(scr);
+ /* Create the new workspace */
+ ws = wWorkspaceNew(scr);
+
+ /* Add the Clip to the workspace */
+ if (!wPreferences.flags.noclip && ws >= 0)
+ scr->workspaces[ws]->clip = wDockCreate(scr, WM_CLIP,
NULL);
+
count--;
}
}
@@ -105,9 +113,6 @@ static int wWorkspaceNew(WScreen *scr)
sprintf(wspace->name, _("Workspace %i"),
scr->workspace_count);
}
- if (!wPreferences.flags.noclip)
- wspace->clip = wDockCreate(scr, WM_CLIP, NULL);
-
list = wmalloc(sizeof(WWorkspace *) * scr->workspace_count);
for (i = 0; i < scr->workspace_count - 1; i++)
@@ -666,11 +671,17 @@ static void newWSCommand(WMenu *menu, WMenuEntry *foo)
void create_new_workspace(WScreen *scr)
{
+ /* Create the new workspace */
int ws = wWorkspaceNew(scr);
- /* autochange workspace */
- if (ws >= 0)
+ /* Add the Clip to the workspace */
+ if (ws >= 0) {
+ if (!wPreferences.flags.noclip)
+ scr->workspaces[ws]->clip = wDockCreate(scr, WM_CLIP,
NULL);
+
+ /* autochange workspace */
wWorkspaceChange(scr, ws);
+ }
}
void wWorkspaceRename(WScreen * scr, int workspace, char *name)
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].