_NET_WM_USER_TIME=0 means don't focus the new window.
authorMikael Magnusson <mikachu@gmail.com>
Wed, 29 Oct 2008 11:35:17 +0000 (12:35 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Wed, 29 Oct 2008 11:35:17 +0000 (12:35 +0100)
openbox/client.c

index 1d78a65..d632194 100644 (file)
@@ -247,6 +247,7 @@ void client_manage(Window window, ObPrompt *prompt)
     gboolean transient = FALSE;
     Rect place, *monitor;
     Time launch_time, map_time;
     gboolean transient = FALSE;
     Rect place, *monitor;
     Time launch_time, map_time;
+    gint user_time;
 
     grab_server(TRUE);
 
 
     grab_server(TRUE);
 
@@ -344,6 +345,9 @@ void client_manage(Window window, ObPrompt *prompt)
     /* tell startup notification that this app started */
     launch_time = sn_app_started(self->startup_id, self->class, self->name);
 
     /* tell startup notification that this app started */
     launch_time = sn_app_started(self->startup_id, self->class, self->name);
 
+    if (!PROP_GET32(self->window, net_wm_user_time, cardinal, &user_time))
+        user_time = map_time;
+
     /* do this after we have a frame.. it uses the frame to help determine the
        WM_STATE to apply. */
     client_change_state(self);
     /* do this after we have a frame.. it uses the frame to help determine the
        WM_STATE to apply. */
     client_change_state(self);
@@ -360,6 +364,8 @@ void client_manage(Window window, ObPrompt *prompt)
         /* this means focus=true for window is same as config_focus_new=true */
         ((config_focus_new || (settings && settings->focus == 1)) ||
          client_search_focus_tree_full(self)) &&
         /* this means focus=true for window is same as config_focus_new=true */
         ((config_focus_new || (settings && settings->focus == 1)) ||
          client_search_focus_tree_full(self)) &&
+        /* NET_WM_USER_TIME 0 when mapping means don't focus */
+        (user_time != 0) &&
         /* this checks for focus=false for the window */
         (!settings || settings->focus != 0) &&
         focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE))
         /* this checks for focus=false for the window */
         (!settings || settings->focus != 0) &&
         focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE))