Ensure that when a workspace is removed from the middle of the list, the

_NET_WM_DESKTOP props on windows on following workspaces are correctly set.
This commit is contained in:
Tomas Frydrych 2009-01-09 15:04:53 +00:00
parent d6b974ba15
commit 95fa3a3879
3 changed files with 31 additions and 0 deletions

View File

@ -1157,6 +1157,7 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace,
{ {
GList *l; GList *l;
MetaWorkspace *neighbour = NULL; MetaWorkspace *neighbour = NULL;
GList *next = NULL;
l = screen->workspaces; l = screen->workspaces;
while (l) while (l)
@ -1165,6 +1166,9 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace,
if (w == workspace) if (w == workspace)
{ {
if (l->next)
next = l->next;
if (l->prev) if (l->prev)
neighbour = l->prev->data; neighbour = l->prev->data;
else if (l->next) else if (l->next)
@ -1191,6 +1195,16 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace,
set_number_of_spaces_hint (screen, g_list_length (screen->workspaces)); set_number_of_spaces_hint (screen, g_list_length (screen->workspaces));
l = next;
while (l)
{
MetaWorkspace *w = l->data;
meta_workspace_update_window_hints (w);
l = l->next;
}
meta_screen_queue_workarea_recalc (screen); meta_screen_queue_workarea_recalc (screen);
g_object_notify (G_OBJECT (screen), "n-workspaces"); g_object_notify (G_OBJECT (screen), "n-workspaces");

View File

@ -498,6 +498,20 @@ meta_workspace_index (MetaWorkspace *workspace)
return ret; return ret;
} }
void
meta_workspace_update_window_hints (MetaWorkspace *workspace)
{
GList *l = workspace->windows;
while (l)
{
MetaWindow *win = l->data;
meta_window_set_current_workspace_hint (win);
l = l->next;
}
}
/* get windows contained on workspace, including workspace->windows /* get windows contained on workspace, including workspace->windows
* and also sticky windows. * and also sticky windows.
*/ */

View File

@ -72,4 +72,7 @@ void meta_workspace_activate (MetaWorkspace *workspace, guint32 timestamp);
void meta_workspace_activate_with_focus (MetaWorkspace *workspace, void meta_workspace_activate_with_focus (MetaWorkspace *workspace,
MetaWindow *focus_this, MetaWindow *focus_this,
guint32 timestamp); guint32 timestamp);
void meta_workspace_update_window_hints (MetaWorkspace *workspace);
#endif #endif