]> Dogcows Code - chaz/openbox/commitdiff
make sure clients stay on screen when the root window changes size, and maximized...
authorDana Jansens <danakj@orodu.net>
Tue, 27 Apr 2010 21:24:51 +0000 (17:24 -0400)
committerDana Jansens <danakj@orodu.net>
Wed, 28 Apr 2010 16:58:46 +0000 (12:58 -0400)
openbox/client.c
openbox/screen.c

index 0a150fc3b3be5bd48fa82129c7b688164f586587..8acbf841877b527d0fd8a4f1b00ef5f3e8b65e18 100644 (file)
@@ -3197,6 +3197,11 @@ void client_fullscreen(ObClient *self, gboolean fs)
     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);
 
@@ -3339,6 +3344,11 @@ void client_maximize(ObClient *self, gboolean max, gint dir)
     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 */
 
     client_setup_decor_and_functions(self, FALSE);
index 5246d341ed22462bdbf55e778ff6058ee4eacd29..4b91a6dd23f9812700adfe2152a55e4b968c34e1 100644 (file)
@@ -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 @@ void screen_update_areas(void)
                     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);
 }
This page took 0.027336 seconds and 4 git commands to generate.