]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
Bug in choosing the active monitor when doing a move/resize
[chaz/openbox] / openbox / screen.c
index 5ca0832ce29a6fefd4d0a4bc83b876ae5544e80b..899b4bc3700dc482141a17bbda6ac20988b01b5a 100644 (file)
@@ -727,6 +727,15 @@ void screen_set_desktop(guint num, gboolean dofocus)
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
             client_hide(c);
+            if (c == focus_client) {
+                /* c was focused and we didn't do fallback clearly so make sure
+                   openbox doesnt still consider the window focused.
+                   this happens when using NextWindow with allDesktops, since
+                   it doesnt want to move focus on desktop change, but the
+                   focus is not going to stay with the current window, which
+                   has now disappeared */
+                focus_set_client(NULL);
+            }
         }
     }
 
@@ -1469,6 +1478,9 @@ void screen_update_areas(void)
                     b = MAX(b, s->strut->bottom);
             }
 
+            /* if the monitor is not against the edge of the root window,
+               the struts will include the distance from the root window's edge
+               to the monitor, so add that back into the monitor's work area */
             if (l) l += RECT_LEFT  (monitor_area[screen_num_monitors])
                         - RECT_LEFT  (monitor_area[i]);
             if (t) t += RECT_TOP   (monitor_area[screen_num_monitors])
@@ -1717,7 +1729,7 @@ Rect* screen_physical_area_active(void)
     gint x, y;
 
     if (moveresize_client)
-        a = screen_physical_area_monitor(client_monitor(focus_client));
+        a = screen_physical_area_monitor(client_monitor(moveresize_client));
     else if (focus_client)
         a = screen_physical_area_monitor(client_monitor(focus_client));
     else {
This page took 0.021355 seconds and 4 git commands to generate.