]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
Fix the Focus/Activate actions to focus windows on other desktops correctly
[chaz/openbox] / openbox / client.c
index 6113062b9fedd74474b5f03c8ffc63ab246b466b..b3f95364b9cad5fdf4536ab1e20d92a864dcb0aa 100644 (file)
@@ -370,7 +370,8 @@ void client_manage(Window window, ObPrompt *prompt)
         (user_time != 0) &&
         /* this checks for focus=false for the window */
         (!settings || settings->focus != 0) &&
-        focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE))
+        focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE,
+                           settings->focus == 1))
     {
         activate = TRUE;
     }
@@ -505,9 +506,10 @@ void client_manage(Window window, ObPrompt *prompt)
 
         if (!activate) {
             /* if the client isn't stealing focus, then hilite it so the user
-               knows it is there */
-            /* XXX don't do this if we're restoring from a session */
-            client_hilite(self, TRUE);
+               knows it is there, but don't do this if we're restoring from a
+               session */
+            if (!client_restore_session_stacking(self))
+                client_hilite(self, TRUE);
         }
     }
     else {
@@ -2621,10 +2623,6 @@ gboolean client_hide(ObClient *self)
     gboolean hide = FALSE;
 
     if (!client_should_show(self)) {
-        if (self == focus_client) {
-            event_cancel_all_key_grabs();
-        }
-
         /* We don't need to ignore enter events here.
            The window can hide/iconify in 3 different ways:
            1 - through an x message. in this case we ignore all enter events
@@ -3875,8 +3873,6 @@ gboolean client_focus(ObClient *self)
        go moving on us */
     event_halt_focus_delay();
 
-    event_cancel_all_key_grabs();
-
     xerror_set_ignore(TRUE);
     xerror_occured = FALSE;
 
@@ -3935,10 +3931,12 @@ static void client_present(ObClient *self, gboolean here, gboolean raise,
 }
 
 /* this function exists to map to the net_active_window message in the ewmh */
-void client_activate(ObClient *self, gboolean here, gboolean raise,
+void client_activate(ObClient *self, gboolean desktop,
+                     gboolean here, gboolean raise,
                      gboolean unshade, gboolean user)
 {
-    if ((user && (self->desktop == DESKTOP_ALL ||
+    if ((user && (desktop ||
+                  self->desktop == DESKTOP_ALL ||
                   self->desktop == screen_desktop)) ||
         client_can_steal_focus(self, event_curtime, CurrentTime))
     {
This page took 0.024783 seconds and 4 git commands to generate.