all repos — openbox @ 632eb082277eb74d5e64beda779eee5b4456ca18

openbox fork - make it a bit more like ryudo

allow new windows on other desktops to get focused if specified in a per-app rule

you can not client_active() with user=false and desktop=true and activate things on other desktops, by the general focus steal restrictions, if you wanted to do that sorta thing
Dana Jansens danakj@orodu.net
commit

632eb082277eb74d5e64beda779eee5b4456ca18

parent

fa39954c9dd5e5212816d0b5006451734137a74c

1 files changed, 14 insertions(+), 8 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -108,8 +108,9 @@ ObStackingLayer layer);

static void client_call_notifies(ObClient *self, GSList *list); static void client_ping_event(ObClient *self, gboolean dead); static void client_prompt_kill(ObClient *self); -static gboolean client_can_steal_focus(ObClient *self, Time steal_time, - Time launch_time); +static gboolean client_can_steal_focus(ObClient *self, + gboolean allow_other_desktop, + Time steal_time, Time launch_time); void client_startup(gboolean reconfig) {

@@ -440,7 +441,8 @@

ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s", activate ? "yes" : "no"); if (activate) { - activate = client_can_steal_focus(self, event_time(), launch_time); + activate = client_can_steal_focus(self, (settings && settings->focus), + event_time(), launch_time); if (!activate) { /* if the client isn't stealing focus, then hilite it so the user

@@ -698,7 +700,9 @@ frame_free(self->frame);

g_slice_free(ObClient, self); } -static gboolean client_can_steal_focus(ObClient *self, Time steal_time, +static gboolean client_can_steal_focus(ObClient *self, + gboolean allow_other_desktop, + Time steal_time, Time launch_time) { gboolean steal;

@@ -720,11 +724,13 @@ "launched at %u (last user interaction time %u)",

self->window, steal_time, launch_time, event_last_user_time); - /* if it's on another desktop */ + /* if it's on another desktop... */ if (!(self->desktop == screen_desktop || self->desktop == DESKTOP_ALL) && - /* the timestamp is from before you changed desktops */ - (!launch_time || + /* and (we dont know when it launched, and we don't want to allow + focus stealing from other desktops */ + ((!launch_time && !allow_other_desktop) || + /* or the timestamp is from before you changed desktops) */ (screen_desktop_user_time && !event_time_after(launch_time, screen_desktop_user_time)))) {

@@ -3948,7 +3954,7 @@ {

if ((user && (desktop || self->desktop == DESKTOP_ALL || self->desktop == screen_desktop)) || - client_can_steal_focus(self, event_time(), CurrentTime)) + client_can_steal_focus(self, desktop, event_time(), CurrentTime)) { client_present(self, here, raise, unshade); }