diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-03-19 07:08:15 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-03-19 07:08:15 +0000 |
| commit | 648c55b829e09c66222a9bbf08d10434622feae2 (patch) | |
| tree | 7e6c2eb58a71e4691c9c5d85325b9d9000019138 /openbox/screen.c | |
| parent | 597fad9d8d5b7be27cabeeec750ed15f86377a07 (diff) | |
move the focus_order lists into the kernel
Diffstat (limited to 'openbox/screen.c')
| -rw-r--r-- | openbox/screen.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/openbox/screen.c b/openbox/screen.c index 8f60029a..01acbfe2 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -195,7 +195,7 @@ void screen_resize() void screen_set_num_desktops(guint num) { - guint old; + guint i, old; gulong *viewport; g_assert(num > 0); @@ -237,6 +237,16 @@ 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; + dispatch_ob(Event_Ob_NumDesktops, num, old); /* change our desktop if we're on one that no longer exists! */ |
