summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-08 00:58:10 +0000
committerDana Jansens <danakj@orodu.net>2003-09-08 00:58:10 +0000
commit50d70283347236df2ce43718c73b0568067b9629 (patch)
tree5993f88cdf12dd72b328517edd8d80107ea612a2 /openbox
parent237cc7278bb57033dad93420d02552e6a910ae82 (diff)
move windows around before removing the focus order lists to prevent nasty segfault when it removes a window from an already freed list
Diffstat (limited to 'openbox')
-rw-r--r--openbox/screen.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/openbox/screen.c b/openbox/screen.c
index 53dce6e7..656206bf 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -366,29 +366,29 @@ void screen_set_num_desktops(guint num)
/* may be some unnamed desktops that we need to fill in with names */
screen_update_desktop_names();
- /* update the focus lists */
- /* free our lists for the desktops which have disappeared */
- for (i = num; i < old; ++i)
- g_list_free(focus_order[i]);
- /* realloc the array */
- focus_order = g_renew(GList*, focus_order, num);
- /* set the new lists to be empty */
- for (i = old; i < num; ++i)
- focus_order[i] = NULL;
-
/* move windows on desktops that will no longer exist! */
for (it = client_list; it != NULL; it = it->next) {
ObClient *c = it->data;
if (c->desktop >= num && c->desktop != DESKTOP_ALL)
client_set_desktop(c, num - 1, FALSE);
}
-
+
/* change our struts/area to match (after moving windows) */
screen_update_areas();
/* change our desktop if we're on one that no longer exists! */
if (screen_desktop >= screen_num_desktops)
screen_set_desktop(num - 1);
+
+ /* update the focus lists */
+ /* free our lists for the desktops which have disappeared */
+ for (i = num; i < old; ++i)
+ g_list_free(focus_order[i]);
+ /* realloc the array */
+ focus_order = g_renew(GList*, focus_order, num);
+ /* set the new lists to be empty */
+ for (i = old; i < num; ++i)
+ focus_order[i] = NULL;
}
void screen_set_desktop(guint num)