]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
refactor all the session stuff. yay, it works properly now.
[chaz/openbox] / openbox / screen.c
index a302828baf1a7a293d87dc995e6efce2cbb687a5..a32f649f0a5348a64c33d00f31dce70ac9fa1157 100644 (file)
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "screen.h"
 #include "client.h"
+#include "session.h"
 #include "frame.h"
 #include "event.h"
 #include "focus.h"
@@ -157,6 +158,7 @@ gboolean screen_annex()
     XSetWindowAttributes attrib;
     pid_t pid;
     gint i, num_support;
+    Atom *prop_atoms_start, *wm_supported_pos;
     gulong *supported;
 
     /* create the netwm support window */
@@ -205,12 +207,15 @@ gboolean screen_annex()
                window, screen_support_win);
 
     /* set the _NET_SUPPORTED_ATOMS hint */
-    num_support = 55;
-#ifdef SYNC
-    num_support += 2;
-#endif
+
+    /* this is all the atoms after net_supported in the prop_atoms struct */
+    prop_atoms_start = (Atom*)&prop_atoms;
+    wm_supported_pos = (Atom*)&(prop_atoms.net_supported);
+    num_support = sizeof(prop_atoms) / sizeof(Atom) -
+        (wm_supported_pos - prop_atoms_start) - 1;
     i = 0;
     supported = g_new(gulong, num_support);
+    supported[i++] = prop_atoms.net_supporting_wm_check;
     supported[i++] = prop_atoms.net_wm_full_placement;
     supported[i++] = prop_atoms.net_current_desktop;
     supported[i++] = prop_atoms.net_number_of_desktops;
@@ -230,6 +235,9 @@ gboolean screen_annex()
     supported[i++] = prop_atoms.net_wm_visible_icon_name;
     supported[i++] = prop_atoms.net_wm_desktop;
     supported[i++] = prop_atoms.net_wm_strut;
+    supported[i++] = prop_atoms.net_wm_strut_partial;
+    supported[i++] = prop_atoms.net_wm_icon;
+    supported[i++] = prop_atoms.net_wm_icon_geometry;
     supported[i++] = prop_atoms.net_wm_window_type;
     supported[i++] = prop_atoms.net_wm_window_type_desktop;
     supported[i++] = prop_atoms.net_wm_window_type_dock;
@@ -265,11 +273,20 @@ gboolean screen_annex()
     supported[i++] = prop_atoms.net_wm_moveresize;
     supported[i++] = prop_atoms.net_wm_user_time;
     supported[i++] = prop_atoms.net_frame_extents;
+    supported[i++] = prop_atoms.net_startup_id;
 #ifdef SYNC
     supported[i++] = prop_atoms.net_wm_sync_request;
     supported[i++] = prop_atoms.net_wm_sync_request_counter;
 #endif
-    supported[i++] = prop_atoms.ob_wm_state_undecorated;
+
+    supported[i++] = prop_atoms.kde_wm_change_state;
+    supported[i++] = prop_atoms.kde_net_wm_frame_strut;
+    supported[i++] = prop_atoms.kde_net_wm_window_type_override;
+
+    supported[i++] = prop_atoms.openbox_wm_state_undecorated;
+    supported[i++] = prop_atoms.openbox_pid;
+    supported[i++] = prop_atoms.openbox_config;
+    supported[i++] = prop_atoms.openbox_control;
     g_assert(i == num_support);
 
     PROP_SETA32(RootWindow(ob_display, ob_screen),
@@ -312,7 +329,10 @@ void screen_startup(gboolean reconfig)
             d < screen_num_desktops)
         {
             screen_set_desktop(d);
-        } else
+        } else if (session_desktop >= 0)
+            screen_set_desktop(MIN((guint)session_desktop,
+                                   screen_num_desktops));
+        else
             screen_set_desktop(MIN(config_screen_firstdesk,
                                    screen_num_desktops) - 1);
 
@@ -860,7 +880,7 @@ void screen_update_desktop_names()
     }
 }
 
-void screen_show_desktop(gboolean show)
+void screen_show_desktop(gboolean show, gboolean restore_focus)
 {
     GList *it;
      
@@ -895,7 +915,7 @@ void screen_show_desktop(gboolean show)
                 client_focus(it->data))
                 break;
         }
-    } else {
+    } else if (restore_focus) {
         ObClient *c;
 
         /* use NULL for the "old" argument because the desktop was focused
This page took 0.026013 seconds and 4 git commands to generate.