]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
Add _OB_VERSION and _OB_APP_ROLE/CLASS/NAME/TYPE
[chaz/openbox] / openbox / screen.c
index 76ad1f274803e65f69997a01efd9a14341bc8098..5ae07907b3ea1a17c10cfe24a3c54121a8f69121 100644 (file)
@@ -33,6 +33,7 @@
 #include "frame.h"
 #include "event.h"
 #include "focus.h"
+#include "focus_cycle.h"
 #include "popup.h"
 #include "extensions.h"
 #include "render/render.h"
@@ -302,15 +303,20 @@ gboolean screen_annex(void)
     supported[i++] = prop_atoms.ob_theme;
     supported[i++] = prop_atoms.ob_config_file;
     supported[i++] = prop_atoms.ob_control;
-    supported[i++] = prop_atoms.ob_role;
-    supported[i++] = prop_atoms.ob_name;
-    supported[i++] = prop_atoms.ob_class;
+    supported[i++] = prop_atoms.ob_version;
+    supported[i++] = prop_atoms.ob_app_role;
+    supported[i++] = prop_atoms.ob_app_name;
+    supported[i++] = prop_atoms.ob_app_class;
+    supported[i++] = prop_atoms.ob_app_type;
     g_assert(i == num_support);
 
     PROP_SETA32(RootWindow(ob_display, ob_screen),
                 net_supported, atom, supported, num_support);
     g_free(supported);
 
+    PROP_SETS(RootWindow(ob_display, ob_screen), ob_version,
+              OB_VERSION);
+
     screen_tell_ksplash();
 
     return TRUE;
@@ -707,7 +713,8 @@ void screen_set_desktop(guint num, gboolean dofocus)
     for (it = stacking_list; it; it = g_list_next(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            client_show(c);
+            if (client_show(c))
+                focus_cycle_add(c);
         }
     }
 
@@ -717,14 +724,20 @@ void screen_set_desktop(guint num, gboolean dofocus)
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            if (client_hide(c) && 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);
+            if (client_hide(c)) {
+                focus_cycle_remove(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.
+                       only do this if the client was actually hidden,
+                       otherwise it can keep focus. */
+                    focus_set_client(NULL);
+                }
             }
         }
     }
This page took 0.02157 seconds and 4 git commands to generate.