]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
only restack group windows on the same desktop
[chaz/openbox] / openbox / screen.c
index 2556b94c9486b7237adeff6b46d97ecca86ea1cb..d2fe9c5bc4196f2c7e30f9993d2633fcf600f6ad 100644 (file)
@@ -201,7 +201,7 @@ gboolean screen_annex()
                window, screen_support_win);
 
     /* set the _NET_SUPPORTED_ATOMS hint */
-    num_support = 50;
+    num_support = 51;
     i = 0;
     supported = g_new(guint32, num_support);
     supported[i++] = prop_atoms.net_current_desktop;
@@ -254,6 +254,7 @@ gboolean screen_annex()
     supported[i++] = prop_atoms.net_wm_state_below;
     supported[i++] = prop_atoms.net_moveresize_window;
     supported[i++] = prop_atoms.net_wm_moveresize;
+    supported[i++] = prop_atoms.ob_wm_state_undecorated;
     g_assert(i == num_support);
 /*
   supported[] = prop_atoms.net_wm_action_stick;
@@ -437,16 +438,16 @@ void screen_set_desktop(guint num)
     /* show windows before hiding the rest to lessen the enter/leave events */
 
     /* show windows from top to bottom */
-    for (it = stacking_list; it != NULL; it = it->next) {
+    for (it = stacking_list; it; it = g_list_next(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            if (!c->frame->visible && client_should_show(c))
+            if (client_should_show(c))
                 frame_show(c->frame);
         }
     }
 
     /* hide windows from bottom to top */
-    for (it = g_list_last(stacking_list); it != NULL; it = it->prev) {
+    for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
             if (c->frame->visible && !client_should_show(c))
@@ -456,7 +457,18 @@ void screen_set_desktop(guint num)
 
     event_ignore_queued_enters();
 
-    focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
+    focus_hilite = focus_fallback_target(OB_FOCUS_FALLBACK_NOFOCUS);
+    if (focus_hilite) {
+        frame_adjust_focus(focus_hilite->frame, TRUE);
+
+        /*!
+          When this focus_client check is not used, you can end up with races,
+          as demonstrated with gnome-panel, sometmies the window you click on
+          another desktop ends up losing focus cuz of the focus change here.
+        */
+        /*if (!focus_client)*/
+        client_focus(focus_hilite);
+    }
 }
 
 static void get_row_col(guint d, guint *r, guint *c)
@@ -567,7 +579,7 @@ static guint translate_row_col(guint r, guint c)
     return 0;
 }
 
-static void popup_cycle(guint d, gboolean show)
+void screen_desktop_popup(guint d, gboolean show)
 {
     Rect *a;
 
@@ -686,14 +698,14 @@ guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
     }
 
     if (dialog) {
-        popup_cycle(d, TRUE);
+        screen_desktop_popup(d, TRUE);
         return d;
     }
 
 done_cycle:
     first = TRUE;
 
-    popup_cycle(0, FALSE);
+    screen_desktop_popup(0, FALSE);
 
     return d;
 }
@@ -859,10 +871,10 @@ void screen_install_colormap(ObClient *client, gboolean install)
     XWindowAttributes wa;
 
     if (client == NULL) {
-       if (install)
-           XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
-       else
-           XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
+        if (install)
+            XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
+        else
+            XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
     } else {
         if (XGetWindowAttributes(ob_display, client->window, &wa) &&
             wa.colormap != None) {
This page took 0.02278 seconds and 4 git commands to generate.