]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
only grab keybinds on the root window, not every client window
[chaz/openbox] / openbox / client.c
index fceac8755836690df529d53ea88138816ec84013..ac500e319a2ae140cb34c57956d8e2e8b67f3821 100644 (file)
@@ -374,7 +374,6 @@ void client_manage(Window window)
              self->window, newx, newy, self->area.width, self->area.height);
     client_apply_startup_state(self, newx, newy);
 
-    keyboard_grab_for_client(self, TRUE);
     mouse_grab_for_client(self, TRUE);
 
     if (activate) {
@@ -385,10 +384,18 @@ void client_manage(Window window)
         ob_debug("Want to focus new window 0x%x with time %u (last time %u)\n",
                  self->window, self->user_time, last_time);
 
-        /* If a nothing at all, or a parent was focused, then focus this
+        /* if it's on another desktop */
+        if (!(self->desktop == screen_desktop || self->desktop == DESKTOP_ALL)
+            && /* the timestamp is from before you changed desktops */
+            self->user_time && screen_desktop_user_time &&
+            !event_time_after(self->user_time, screen_desktop_user_time))
+        {
+            activate = FALSE;
+        }
+        /* If nothing is focused, or a parent was focused, then focus this
            always
         */
-        if (!focus_client || client_search_focus_parent(self) != NULL)
+        else if (!focus_client || client_search_focus_parent(self) != NULL)
             activate = TRUE;
         else
         {
@@ -482,7 +489,6 @@ void client_unmanage(ObClient *self)
         event_ignore_queued_enters();
     }
 
-    keyboard_grab_for_client(self, FALSE);
     mouse_grab_for_client(self, FALSE);
 
     /* remove the window from our save set */
@@ -3106,6 +3112,9 @@ void client_activate(ObClient *self, gboolean here, gboolean user)
     {
         client_hilite(self, TRUE);
     } else {
+        if (event_curtime != CurrentTime)
+            self->user_time = event_curtime;
+
         /* if using focus_delay, stop the timer now so that focus doesn't
            go moving on us */
         event_halt_focus_delay();
This page took 0.02092 seconds and 4 git commands to generate.