]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
remove grab_pointer_window, nothing used it
[chaz/openbox] / openbox / screen.c
index cf94462c71f37c898b180d04e55b98bc2e9e066e..2d34f2632cd07060886f94b0dd0e6f16167999a5 100644 (file)
@@ -166,7 +166,7 @@ gboolean screen_annex()
                                        CopyFromParent, InputOutput,
                                        CopyFromParent,
                                        CWOverrideRedirect, &attrib);
-    XMapRaised(ob_display, screen_support_win);
+    XMapWindow(ob_display, screen_support_win);
 
     if (!replace_wm()) {
         XDestroyWindow(ob_display, screen_support_win);
@@ -300,8 +300,16 @@ void screen_startup(gboolean reconfig)
         screen_num_desktops = 0;
     screen_set_num_desktops(config_desktops_num);
     if (!reconfig) {
-        screen_set_desktop(MIN(config_screen_firstdesk, screen_num_desktops)
-                           - 1);
+        guint32 d;
+        /* start on the current desktop when a wm was already running */
+        if (PROP_GET32(RootWindow(ob_display, ob_screen),
+                       net_current_desktop, cardinal, &d) &&
+            d < screen_num_desktops)
+        {
+            screen_set_desktop(d);
+        } else
+            screen_set_desktop(MIN(config_screen_firstdesk,
+                                   screen_num_desktops) - 1);
 
         /* don't start in showing-desktop mode */
         screen_showing_desktop = FALSE;
@@ -435,11 +443,11 @@ void screen_set_desktop(guint num)
 
     /* show windows before hiding the rest to lessen the enter/leave events */
 
-    /* show windows from top to bottom */
+    /* show/hide windows from top to bottom */
     for (it = stacking_list; it; it = g_list_next(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            client_showhide(c);
+            client_show(c);
         }
     }
 
@@ -447,7 +455,7 @@ void screen_set_desktop(guint num)
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            client_showhide(c);
+            client_hide(c);
         }
     }
 
@@ -458,9 +466,10 @@ void screen_set_desktop(guint num)
         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.
+          When this focus_client check is not used, you can end up with
+          races, as demonstrated with gnome-panel, sometimes the window
+          you click on another desktop ends up losing focus cuz of the
+          focus change here.
         */
         /*if (!focus_client)*/
         client_focus(focus_hilite);
@@ -882,11 +891,25 @@ void screen_show_desktop(gboolean show)
             ObClient *c = it->data;
             if (c->type == OB_CLIENT_TYPE_DESKTOP &&
                 (c->desktop == screen_desktop || c->desktop == DESKTOP_ALL) &&
-                client_validate(it->data) && client_focus(it->data))
+                client_focus(it->data))
                 break;
         }
     } else {
-        focus_fallback(TRUE);
+        /* use NULL for the "old" argument because the desktop was focused
+           and we don't want to fallback to the desktop by default */
+        focus_hilite = focus_fallback_target(TRUE, NULL);
+        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, sometimes the window
+              you click on another desktop ends up losing focus cuz of the
+              focus change here.
+            */
+            /*if (!focus_client)*/
+            client_focus(focus_hilite);
+        }
     }
 
     show = !!show; /* make it boolean */
This page took 0.02738 seconds and 4 git commands to generate.