make sure clients stay on screen when the root window changes size, and maximized/fullscreen windows must be on some monitor or it doesn't make much sense (and asserts)
Dana Jansens danakj@orodu.net
2 files changed,
21 insertions(+),
2 deletions(-)
M
openbox/client.c
→
openbox/client.c
@@ -3197,6 +3197,11 @@
ob_debug("Window %s going fullscreen (%d)", self->title, self->fullscreen); + if (fs) { + /* make sure the window is on some monitor */ + client_find_onscreen(self, &x, &y, w, h, FALSE); + } + client_setup_decor_and_functions(self, FALSE); client_move_resize(self, x, y, w, h);@@ -3338,6 +3343,11 @@ if (dir == 0 || dir == 1) /* horz */
self->max_horz = max; if (dir == 0 || dir == 2) /* vert */ self->max_vert = max; + + if (max) { + /* make sure the window is on some monitor */ + client_find_onscreen(self, &x, &y, w, h, FALSE); + } client_change_state(self); /* change the state hints on the client */
M
openbox/screen.c
→
openbox/screen.c
@@ -1374,7 +1374,14 @@ void screen_update_areas(void)
{ guint i; gulong *dims; - GList *it; + GList *it, *onscreen; + + /* collect the clients that are on screen */ + onscreen = NULL; + for (it = client_list; it; it = g_list_next(it)) { + if (client_monitor(it->data) != screen_num_monitors) + onscreen = g_list_prepend(onscreen, it->data); + } g_free(monitor_area); get_xinerama_screens(&monitor_area, &screen_num_monitors);@@ -1448,8 +1455,10 @@ OBT_PROP_SETA32(obt_root(ob_screen), NET_WORKAREA, CARDINAL,
dims, 4 * screen_num_desktops); /* the area has changed, adjust all the windows if they need it */ - for (it = client_list; it; it = g_list_next(it)) + for (it = onscreen; it; it = g_list_next(it)) { + client_move_onscreen(it->data, FALSE); client_reconfigure(it->data, FALSE); + } g_free(dims); }