diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-07-20 20:37:18 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-07-20 20:37:18 -0400 |
| commit | 9091da403e1a40f5a638ae5878fe7c8c0a4a3da8 (patch) | |
| tree | f7ab75d9b03f58501c3ab1c170f4a59332655763 /openbox | |
| parent | eb0e48340536c7ee089d02fb335590592f0175eb (diff) | |
don't move parents and children over when inserting desktops - cuz then they all get moved a bunch of times, just move the top direct parent
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/screen.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/openbox/screen.c b/openbox/screen.c index 6f51bc1b..9bbd13d1 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -641,8 +641,14 @@ void screen_add_desktop(gboolean current) for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; - if (c->desktop != DESKTOP_ALL && c->desktop >= screen_desktop) + if (c->desktop != DESKTOP_ALL && c->desktop >= screen_desktop && + /* don't move direct children, they'll be moved with their + parent - which will have to be on the same desktop */ + !client_direct_parent(c)) + { + ob_debug("moving window %s\n", c->title); client_set_desktop(c, c->desktop+1, FALSE, TRUE); + } } } } @@ -670,9 +676,13 @@ void screen_remove_desktop(gboolean current) if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; guint d = c->desktop; - if (d != DESKTOP_ALL && d >= movedesktop) { - client_set_desktop(c, c->desktop - 1, TRUE, TRUE); + if (d != DESKTOP_ALL && d >= movedesktop && + /* don't move direct children, they'll be moved with their + parent - which will have to be on the same desktop */ + !client_direct_parent(c)) + { ob_debug("moving window %s\n", c->title); + client_set_desktop(c, c->desktop - 1, TRUE, TRUE); } /* raise all the windows that are on the current desktop which is being merged */ |
