1 /* workspace.c- Workspace management
3 * Window Maker window manager
5 * Copyright (c) 1997, 1998 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 #include <X11/Xutil.h>
27 #include <X11/extensions/shape.h>
37 #include "WindowMaker.h"
44 #include "application.h"
47 #include "workspace.h"
59 extern WPreferences wPreferences
;
60 extern XContext wWinContext
;
63 static proplist_t dWorkspaces
=NULL
;
64 static proplist_t dClip
, dName
;
70 if (dWorkspaces
!=NULL
)
73 dWorkspaces
= PLMakeString("Workspaces");
74 dName
= PLMakeString("Name");
75 dClip
= PLMakeString("Clip");
80 wWorkspaceMake(WScreen
*scr
, int count
)
90 wWorkspaceNew(WScreen
*scr
)
92 WWorkspace
*wspace
, **list
;
95 if (scr
->workspace_count
< MAX_WORKSPACES
) {
96 scr
->workspace_count
++;
98 wspace
= wmalloc(sizeof(WWorkspace
));
102 if (scr
->flags
.kwm_syncing_count
) {
103 wspace
->name
= wKWMGetWorkspaceName(scr
, scr
->workspace_count
-1);
107 wspace
->name
= wmalloc(strlen(_("Workspace %i"))+8);
108 sprintf(wspace
->name
, _("Workspace %i"), scr
->workspace_count
);
112 if (!wPreferences
.flags
.noclip
) {
113 wspace
->clip
= wDockCreate(scr
, WM_CLIP
);
117 list
= wmalloc(sizeof(WWorkspace
*)*scr
->workspace_count
);
119 for (i
=0; i
<scr
->workspace_count
-1; i
++) {
120 list
[i
] = scr
->workspaces
[i
];
123 free(scr
->workspaces
);
124 scr
->workspaces
= list
;
126 wWorkspaceMenuUpdate(scr
, scr
->workspace_menu
);
127 wWorkspaceMenuUpdate(scr
, scr
->clip_ws_menu
);
129 wGNOMEUpdateWorkspaceHints(scr
);
132 if (!scr
->flags
.kwm_syncing_count
) {
133 wKWMUpdateWorkspaceCountHint(scr
);
134 wKWMUpdateWorkspaceNameHint(scr
, scr
->workspace_count
-1);
137 wKWMSetUsableAreaHint(scr
, scr
->workspace_count
-1);
142 return scr
->workspace_count
-1;
150 wWorkspaceDelete(WScreen
*scr
, int workspace
)
160 /* verify if workspace is in use by some window */
161 tmp
= scr
->focused_window
;
163 if (!IS_OMNIPRESENT(tmp
) && tmp
->frame
->workspace
==workspace
)
168 if (!wPreferences
.flags
.noclip
) {
169 wDockDestroy(scr
->workspaces
[workspace
]->clip
);
170 scr
->workspaces
[workspace
]->clip
= NULL
;
173 list
= wmalloc(sizeof(WWorkspace
*)*(scr
->workspace_count
-1));
175 for (i
=0; i
<scr
->workspace_count
; i
++) {
177 list
[j
++] = scr
->workspaces
[i
];
179 if (scr
->workspaces
[i
]->name
)
180 free(scr
->workspaces
[i
]->name
);
181 free(scr
->workspaces
[i
]);
184 free(scr
->workspaces
);
185 scr
->workspaces
= list
;
187 scr
->workspace_count
--;
191 wWorkspaceMenuUpdate(scr
, scr
->workspace_menu
);
192 /* clip workspace menu */
193 wWorkspaceMenuUpdate(scr
, scr
->clip_ws_menu
);
195 /* update also window menu */
196 if (scr
->workspace_submenu
) {
197 WMenu
*menu
= scr
->workspace_submenu
;
200 while (i
>scr
->workspace_count
)
201 wMenuRemoveItem(menu
, --i
);
205 if (scr
->clip_submenu
) {
206 WMenu
*menu
= scr
->clip_submenu
;
209 while (i
>scr
->workspace_count
)
210 wMenuRemoveItem(menu
, --i
);
215 wGNOMEUpdateWorkspaceHints(scr
);
218 wKWMUpdateWorkspaceCountHint(scr
);
221 if (scr
->current_workspace
>= scr
->workspace_count
)
222 wWorkspaceChange(scr
, scr
->workspace_count
-1);
228 typedef struct WorkspaceNameData
{
238 hideWorkpaceName(void *data
)
240 WScreen
*scr
= (WScreen
*)data
;
242 if (!scr
->workspace_name_data
|| scr
->workspace_name_data
->count
== 0
243 || time(NULL
) > scr
->workspace_name_data
->timeout
) {
244 XUnmapWindow(dpy
, scr
->workspace_name
);
246 if (scr
->workspace_name_data
) {
247 RDestroyImage(scr
->workspace_name_data
->back
);
248 RDestroyImage(scr
->workspace_name_data
->text
);
249 free(scr
->workspace_name_data
);
251 scr
->workspace_name_data
= NULL
;
253 scr
->workspace_name_timer
= NULL
;
255 RImage
*img
= RCloneImage(scr
->workspace_name_data
->back
);
258 scr
->workspace_name_timer
=
259 WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY
, hideWorkpaceName
,
262 RCombineImagesWithOpaqueness(img
, scr
->workspace_name_data
->text
,
263 scr
->workspace_name_data
->count
*255/10);
265 RConvertImage(scr
->rcontext
, img
, &pix
);
269 XSetWindowBackgroundPixmap(dpy
, scr
->workspace_name
, pix
);
270 XClearWindow(dpy
, scr
->workspace_name
);
271 XFreePixmap(dpy
, pix
);
274 scr
->workspace_name_data
->count
--;
281 showWorkspaceName(WScreen
*scr
, int workspace
)
283 WorkspaceNameData
*data
;
288 char *name
= scr
->workspaces
[workspace
]->name
;
289 int len
= strlen(name
);
292 if (wPreferences
.workspace_name_display_position
== WD_NONE
)
295 if (scr
->workspace_name_timer
) {
296 WMDeleteTimerHandler(scr
->workspace_name_timer
);
297 XUnmapWindow(dpy
, scr
->workspace_name
);
300 scr
->workspace_name_timer
= WMAddTimerHandler(WORKSPACE_NAME_DELAY
,
301 hideWorkpaceName
, scr
);
303 if (scr
->workspace_name_data
) {
304 RDestroyImage(scr
->workspace_name_data
->back
);
305 RDestroyImage(scr
->workspace_name_data
->text
);
306 free(scr
->workspace_name_data
);
310 XSetFont(dpy
, scr
->mono_gc
, scr
->workspace_name_font
->font
->fid
);
311 XSetFont(dpy
, scr
->draw_gc
, scr
->workspace_name_font
->font
->fid
);
314 data
= wmalloc(sizeof(WorkspaceNameData
));
316 w
= wTextWidth(scr
->workspace_name_font
->font
, name
, len
);
317 h
= scr
->workspace_name_font
->height
;
319 switch (wPreferences
.workspace_name_display_position
) {
321 px
= (scr
->scr_width
- (w
+4))/2;
322 py
= (scr
->scr_height
- (h
+4))/2;
325 px
= (scr
->scr_width
- (w
+4))/2;
329 px
= (scr
->scr_width
- (w
+4))/2;
330 py
= scr
->scr_height
- h
;
337 px
= scr
->scr_width
- w
;
342 py
= scr
->scr_height
- h
;
345 px
= scr
->scr_width
- w
;
346 py
= scr
->scr_height
- h
;
349 XResizeWindow(dpy
, scr
->workspace_name
, w
+4, h
+4);
350 XMoveWindow(dpy
, scr
->workspace_name
, px
, py
);
352 text
= XCreatePixmap(dpy
, scr
->w_win
, w
+4, h
+4, scr
->w_depth
);
353 mask
= XCreatePixmap(dpy
, scr
->w_win
, w
+4, h
+4, 1);
355 XSetForeground(dpy
, scr
->draw_gc
, scr
->black_pixel
);
356 XFillRectangle(dpy
, text
, scr
->draw_gc
, 0, 0, w
+4, h
+4);
358 XSetForeground(dpy
, scr
->mono_gc
, 0);
359 XFillRectangle(dpy
, mask
, scr
->mono_gc
, 0, 0, w
+4, h
+4);
361 XSetForeground(dpy
, scr
->mono_gc
, 1);
362 for (x
= 0; x
<= 4; x
++) {
363 for (y
= 0; y
<= 4; y
++) {
364 wDrawString(mask
, scr
->workspace_name_font
, scr
->mono_gc
,
365 x
, scr
->workspace_name_font
->y
+ y
, name
, len
);
369 XSetForeground(dpy
, scr
->draw_gc
, scr
->white_pixel
);
370 wDrawString(text
, scr
->workspace_name_font
, scr
->draw_gc
,
371 2, scr
->workspace_name_font
->y
+ 2,
372 scr
->workspaces
[workspace
]->name
,
373 strlen(scr
->workspaces
[workspace
]->name
));
375 XShapeCombineMask(dpy
, scr
->workspace_name
, ShapeBounding
, 0, 0, mask
,
378 XSetWindowBackgroundPixmap(dpy
, scr
->workspace_name
, text
);
379 XClearWindow(dpy
, scr
->workspace_name
);
381 data
->text
= RCreateImageFromDrawable(scr
->rcontext
, text
, None
);
383 XFreePixmap(dpy
, text
);
384 XFreePixmap(dpy
, mask
);
387 XMapRaised(dpy
, scr
->workspace_name
);
393 ximg
= RGetXImage(scr
->rcontext
, scr
->root_win
, px
, py
,
394 data
->text
->width
, data
->text
->height
);
400 XMapRaised(dpy
, scr
->workspace_name
);
403 data
->back
= RCreateImageFromXImage(scr
->rcontext
, ximg
->image
, NULL
);
404 RDestroyXImage(scr
->rcontext
, ximg
);
412 /* set a timeout for the effect */
413 data
->timeout
= time(NULL
) + 2 +
414 (WORKSPACE_NAME_DELAY
+ WORKSPACE_NAME_FADE_DELAY
*data
->count
)/1000;
416 scr
->workspace_name_data
= data
;
422 if (scr
->workspace_name_timer
)
423 WMDeleteTimerHandler(scr
->workspace_name_timer
);
426 RDestroyImage(data
->text
);
428 RDestroyImage(data
->back
);
431 scr
->workspace_name_data
= NULL
;
433 scr
->workspace_name_timer
= WMAddTimerHandler(WORKSPACE_NAME_DELAY
+
434 10*WORKSPACE_NAME_FADE_DELAY
,
435 hideWorkpaceName
, scr
);
440 wWorkspaceChange(WScreen
*scr
, int workspace
)
442 if (scr
->flags
.startup
|| scr
->flags
.startup2
) {
446 if (workspace
!= scr
->current_workspace
) {
447 wWorkspaceForceChange(scr
, workspace
);
449 showWorkspaceName(scr, workspace);
455 wWorkspaceRelativeChange(WScreen
*scr
, int amount
)
459 w
= scr
->current_workspace
+ amount
;
464 wWorkspaceChange(scr
, w
);
465 else if (wPreferences
.ws_cycle
)
466 wWorkspaceChange(scr
, scr
->workspace_count
+ w
);
468 } else if (amount
> 0) {
470 if (w
< scr
->workspace_count
)
471 wWorkspaceChange(scr
, w
);
472 else if (wPreferences
.ws_advance
)
473 wWorkspaceChange(scr
, WMIN(w
, MAX_WORKSPACES
-1));
474 else if (wPreferences
.ws_cycle
)
475 wWorkspaceChange(scr
, w
% scr
->workspace_count
);
482 wWorkspaceForceChange(WScreen
*scr
, int workspace
)
484 WWindow
*tmp
, *foc
=NULL
, *foc2
=NULL
;
486 if (workspace
>= MAX_WORKSPACES
|| workspace
< 0)
489 SendHelperMessage(scr
, 'C', workspace
+1, NULL
);
491 if (workspace
> scr
->workspace_count
-1) {
492 wWorkspaceMake(scr
, workspace
- scr
->workspace_count
+ 1);
495 wClipUpdateForWorkspaceChange(scr
, workspace
);
497 scr
->current_workspace
= workspace
;
499 wWorkspaceMenuUpdate(scr
, scr
->workspace_menu
);
501 wWorkspaceMenuUpdate(scr
, scr
->clip_ws_menu
);
503 if ((tmp
= scr
->focused_window
)!= NULL
) {
504 if (IS_OMNIPRESENT(tmp
) || tmp
->flags
.changing_workspace
)
506 /* foc2 = tmp; will fix annoyance with gnome panel
507 * but will create annoyance for every other application
511 if (tmp
->frame
->workspace
!=workspace
&& !tmp
->flags
.selected
) {
512 /* unmap windows not on this workspace */
513 if ((tmp
->flags
.mapped
||tmp
->flags
.shaded
)
514 && !IS_OMNIPRESENT(tmp
)
515 && !tmp
->flags
.changing_workspace
) {
519 /* also unmap miniwindows not on this workspace */
520 if (tmp
->flags
.miniaturized
&& !IS_OMNIPRESENT(tmp
)
522 if (!wPreferences
.sticky_icons
) {
523 XUnmapWindow(dpy
, tmp
->icon
->core
->window
);
524 tmp
->icon
->mapped
= 0;
526 tmp
->icon
->mapped
= 1;
527 /* Why is this here? -Alfredo */
528 XMapWindow(dpy
, tmp
->icon
->core
->window
);
531 /* update current workspace of omnipresent windows */
532 if (IS_OMNIPRESENT(tmp
)) {
533 WApplication
*wapp
= wApplicationOf(tmp
->main_window
);
535 tmp
->frame
->workspace
= workspace
;
538 wapp
->last_workspace
= workspace
;
544 /* change selected windows' workspace */
545 if (tmp
->flags
.selected
) {
546 wWindowChangeWorkspace(tmp
, workspace
);
547 if (!tmp
->flags
.miniaturized
&& !foc
) {
551 if (!tmp
->flags
.hidden
) {
552 if (!(tmp
->flags
.mapped
|| tmp
->flags
.miniaturized
)) {
553 /* remap windows that are on this workspace */
558 /* Also map miniwindow if not omnipresent */
559 if (!wPreferences
.sticky_icons
&&
560 tmp
->flags
.miniaturized
&&
561 !IS_OMNIPRESENT(tmp
) && tmp
->icon
) {
562 tmp
->icon
->mapped
= 1;
563 XMapWindow(dpy
, tmp
->icon
->core
->window
);
574 if (scr
->focused_window
->flags
.mapped
&& !foc
) {
575 foc
= scr
->focused_window
;
577 if (wPreferences
.focus_mode
== WKF_CLICK
) {
578 wSetFocusTo(scr
, foc
);
586 if (XQueryPointer(dpy
, scr
->root_win
, &bar
, &win
,
587 &foo
, &foo
, &foo
, &foo
, &mask
)) {
588 tmp
= wWindowFor(win
);
590 if (!tmp
&& wPreferences
.focus_mode
== WKF_SLOPPY
) {
591 wSetFocusTo(scr
, foc
);
593 wSetFocusTo(scr
, tmp
);
598 /* We need to always arrange icons when changing workspace, even if
599 * no autoarrange icons, because else the icons in different workspaces
601 * This can be avoided if appicons are also workspace specific.
603 if (!wPreferences
.sticky_icons
)
604 wArrangeIcons(scr
, False
);
607 wAppIconPaint(scr
->dock
->icon_array
[0]);
608 if (scr
->clip_icon
) {
609 if (scr
->workspaces
[workspace
]->clip
->auto_collapse
||
610 scr
->workspaces
[workspace
]->clip
->auto_raise_lower
) {
611 /* to handle enter notify. This will also */
612 XUnmapWindow(dpy
, scr
->clip_icon
->icon
->core
->window
);
613 XMapWindow(dpy
, scr
->clip_icon
->icon
->core
->window
);
615 wClipIconPaint(scr
->clip_icon
);
619 showWorkspaceName(scr
, workspace
);
622 wGNOMEUpdateCurrentWorkspaceHint(scr
);
625 wKWMUpdateCurrentWorkspaceHint(scr
);
627 /* XSync(dpy, False); */
632 switchWSCommand(WMenu
*menu
, WMenuEntry
*entry
)
634 wWorkspaceChange(menu
->frame
->screen_ptr
, (long)entry
->clientdata
);
640 deleteWSCommand(WMenu
*menu
, WMenuEntry
*entry
)
642 wWorkspaceDelete(menu
->frame
->screen_ptr
,
643 menu
->frame
->screen_ptr
->workspace_count
-1);
649 newWSCommand(WMenu
*menu
, WMenuEntry
*foo
)
653 ws
= wWorkspaceNew(menu
->frame
->screen_ptr
);
654 /* autochange workspace*/
656 wWorkspaceChange(menu
->frame
->screen_ptr
, ws
);
662 if (wKeyBindings[WKBD_WORKSPACE1+ws]) {
663 kcode = wKeyBindings[WKBD_WORKSPACE1+ws]->keycode;
665 wstrdup(XKeysymToString(XKeycodeToKeysym(dpy, kcode, 0)));
680 end
= &(line
[strlen(line
)])-1;
681 while (isspace(*line
) && *line
!=0) line
++;
682 while (isspace(*end
) && end
!=line
) {
691 wWorkspaceRename(WScreen
*scr
, int workspace
, char *name
)
693 char buf
[MAX_WORKSPACENAME_WIDTH
+1];
696 if (workspace
>= scr
->workspace_count
)
699 /* trim white spaces */
700 tmp
= cropline(name
);
702 if (strlen(tmp
)==0) {
703 sprintf(buf
, _("Workspace %i"), workspace
+1);
705 strncpy(buf
, tmp
, MAX_WORKSPACENAME_WIDTH
);
707 buf
[MAX_WORKSPACENAME_WIDTH
] = 0;
709 /* update workspace */
710 free(scr
->workspaces
[workspace
]->name
);
711 scr
->workspaces
[workspace
]->name
= wstrdup(buf
);
713 if (scr
->clip_ws_menu
) {
714 if (strcmp(scr
->clip_ws_menu
->entries
[workspace
+2]->text
, buf
)!=0) {
715 free(scr
->clip_ws_menu
->entries
[workspace
+2]->text
);
716 scr
->clip_ws_menu
->entries
[workspace
+2]->text
= wstrdup(buf
);
717 wMenuRealize(scr
->clip_ws_menu
);
720 if (scr
->workspace_menu
) {
721 if (strcmp(scr
->workspace_menu
->entries
[workspace
+2]->text
, buf
)!=0) {
722 free(scr
->workspace_menu
->entries
[workspace
+2]->text
);
723 scr
->workspace_menu
->entries
[workspace
+2]->text
= wstrdup(buf
);
724 wMenuRealize(scr
->workspace_menu
);
728 UpdateSwitchMenuWorkspace(scr
, workspace
);
731 wClipIconPaint(scr
->clip_icon
);
734 wGNOMEUpdateWorkspaceNamesHint(scr
);
737 wKWMUpdateWorkspaceNameHint(scr
, workspace
);
744 /* callback for when menu entry is edited */
746 onMenuEntryEdited(WMenu
*menu
, WMenuEntry
*entry
)
751 wWorkspaceRename(menu
->frame
->screen_ptr
, (long)entry
->clientdata
, tmp
);
756 wWorkspaceMenuMake(WScreen
*scr
, Bool titled
)
760 wsmenu
= wMenuCreate(scr
, titled
? _("Workspaces") : NULL
, False
);
762 wwarning(_("could not create Workspace menu"));
766 /* callback to be called when an entry is edited */
767 wsmenu
->on_edit
= onMenuEntryEdited
;
769 wMenuAddCallback(wsmenu
, _("New"), newWSCommand
, NULL
);
770 wMenuAddCallback(wsmenu
, _("Destroy Last"), deleteWSCommand
, NULL
);
778 wWorkspaceMenuUpdate(WScreen
*scr
, WMenu
*menu
)
782 char title
[MAX_WORKSPACENAME_WIDTH
+1];
789 if (menu
->entry_no
< scr
->workspace_count
+2) {
790 /* new workspace(s) added */
791 i
= scr
->workspace_count
-(menu
->entry_no
-2);
792 ws
= menu
->entry_no
- 2;
794 strcpy(title
, scr
->workspaces
[ws
]->name
);
796 entry
= wMenuAddCallback(menu
, title
, switchWSCommand
, (void*)ws
);
797 entry
->flags
.indicator
= 1;
798 entry
->flags
.editable
= 1;
803 } else if (menu
->entry_no
> scr
->workspace_count
+2) {
804 /* removed workspace(s) */
805 for (i
= menu
->entry_no
-1; i
>= scr
->workspace_count
+2; i
--) {
806 wMenuRemoveItem(menu
, i
);
811 for (i
=0; i
<scr
->workspace_count
; i
++) {
812 menu
->entries
[i
+2]->flags
.indicator_on
= 0;
814 menu
->entries
[scr
->current_workspace
+2]->flags
.indicator_on
= 1;
816 /* don't let user destroy current workspace */
817 if (scr
->current_workspace
== scr
->workspace_count
-1) {
818 wMenuSetEnabled(menu
, 1, False
);
820 wMenuSetEnabled(menu
, 1, True
);
823 tmp
= menu
->frame
->top_width
+ 5;
824 /* if menu got unreachable, bring it to a visible place */
825 if (menu
->frame_x
< tmp
- (int)menu
->frame
->core
->width
)
826 wMenuMove(menu
, tmp
- (int)menu
->frame
->core
->width
, menu
->frame_y
, False
);
833 wWorkspaceSaveState(WScreen
*scr
, proplist_t old_state
)
835 proplist_t parr
, pstr
;
836 proplist_t wks_state
, old_wks_state
;
842 old_wks_state
= PLGetDictionaryEntry(old_state
, dWorkspaces
);
843 parr
= PLMakeArrayFromElements(NULL
);
844 for (i
=0; i
< scr
->workspace_count
; i
++) {
845 pstr
= PLMakeString(scr
->workspaces
[i
]->name
);
846 wks_state
= PLMakeDictionaryFromEntries(dName
, pstr
, NULL
);
848 if (!wPreferences
.flags
.noclip
) {
849 pstr
= wClipSaveWorkspaceState(scr
, i
);
850 PLInsertDictionaryEntry(wks_state
, dClip
, pstr
);
852 } else if (old_wks_state
!=NULL
) {
853 if ((foo
= PLGetArrayElement(old_wks_state
, i
))!=NULL
) {
854 if ((bar
= PLGetDictionaryEntry(foo
, dClip
))!=NULL
) {
855 PLInsertDictionaryEntry(wks_state
, dClip
, bar
);
859 PLAppendArrayElement(parr
, wks_state
);
860 PLRelease(wks_state
);
862 PLInsertDictionaryEntry(scr
->session_state
, dWorkspaces
, parr
);
868 wWorkspaceRestoreState(WScreen
*scr
)
870 proplist_t parr
, pstr
, wks_state
;
871 proplist_t clip_state
;
876 parr
= PLGetDictionaryEntry(scr
->session_state
, dWorkspaces
);
881 wscount
= scr
->workspace_count
;
882 for (i
=0; i
< PLGetNumberOfElements(parr
); i
++) {
883 wks_state
= PLGetArrayElement(parr
, i
);
884 if (PLIsDictionary(wks_state
))
885 pstr
= PLGetDictionaryEntry(wks_state
, dName
);
888 if (i
>= scr
->workspace_count
)
890 if (scr
->workspace_menu
) {
891 free(scr
->workspace_menu
->entries
[i
+2]->text
);
892 scr
->workspace_menu
->entries
[i
+2]->text
= wstrdup(PLGetString(pstr
));
893 scr
->workspace_menu
->flags
.realized
= 0;
895 free(scr
->workspaces
[i
]->name
);
896 scr
->workspaces
[i
]->name
= wstrdup(PLGetString(pstr
));
897 if (!wPreferences
.flags
.noclip
) {
898 clip_state
= PLGetDictionaryEntry(wks_state
, dClip
);
899 if (scr
->workspaces
[i
]->clip
)
900 wDockDestroy(scr
->workspaces
[i
]->clip
);
901 scr
->workspaces
[i
]->clip
= wDockRestoreState(scr
, clip_state
,
904 wDockHideIcons(scr
->workspaces
[i
]->clip
);
907 wKWMUpdateWorkspaceNameHint(scr
, i
);
911 wGNOMEUpdateWorkspaceNamesHint(scr
);