X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fscreen.c;h=9bbd13d183181208873b0769fa1957882e28babe;hb=9091da403e1a40f5a638ae5878fe7c8c0a4a3da8;hp=707d0b6b29fb649c9a4e897af168e4c38bdc14cb;hpb=4b73574406e24df84e909014926e56ab1e5c7934;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 707d0b6b..9bbd13d1 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -532,7 +532,7 @@ void screen_set_num_desktops(guint num) stacking_raise(CLIENT_AS_WINDOW(c)); } } - + /* change our struts/area to match (after moving windows) */ screen_update_areas(); @@ -552,7 +552,7 @@ void screen_set_desktop(guint num, gboolean dofocus) guint old; gulong ignore_start; gboolean allow_omni; - + g_assert(num < screen_num_desktops); old = screen_desktop; @@ -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 */ @@ -1008,7 +1018,7 @@ void screen_update_layout() if (PROP_GETA32(RootWindow(ob_display, ob_screen), net_desktop_layout, cardinal, &data, &num)) { if (num == 3 || num == 4) { - + if (data[0] == prop_atoms.net_wm_orientation_vert) l.orientation = OB_ORIENTATION_VERT; else if (data[0] == prop_atoms.net_wm_orientation_horz) @@ -1090,7 +1100,7 @@ void screen_update_desktop_names() void screen_show_desktop(gboolean show, ObClient *show_only) { GList *it; - + if (show == screen_showing_desktop) return; /* no change */ screen_showing_desktop = show; @@ -1353,7 +1363,7 @@ Rect* screen_area_all_monitors(guint desktop) g_free(m); } - + return a; } #endif