all repos — openbox @ 0116d82463197bea2890230d71a69e4b92489166

openbox fork - make it a bit more like ryudo

don't activate and change desktops if the client's not on the current desktop and its user_time is older than the last time you changed desktops
Dana Jansens danakj@orodu.net
commit

0116d82463197bea2890230d71a69e4b92489166

parent

ca8665e3093108d5b148916de69ffd9a13be88e4

3 files changed, 15 insertions(+), 1 deletions(-)

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

@@ -385,10 +385,18 @@ /* This is focus stealing prevention */

ob_debug("Want to focus new window 0x%x with time %u (last time %u)\n", self->window, self->user_time, last_time); + /* 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 {
M openbox/screen.copenbox/screen.c

@@ -58,6 +58,7 @@ gboolean screen_showing_desktop;

DesktopLayout screen_desktop_layout; gchar **screen_desktop_names; Window screen_support_win; +Time screen_desktop_user_time = CurrentTime; static Rect **area; /* array of desktop holding array of xinerama areas */ static Rect *monitor_area;

@@ -475,6 +476,9 @@ client_focus(c);

} event_ignore_queued_enters(); + + if (event_curtime != CurrentTime) + screen_desktop_user_time = event_curtime; } static void get_row_col(guint d, guint *r, guint *c)
M openbox/screen.hopenbox/screen.h

@@ -38,6 +38,8 @@ /*! Are we in showing-desktop mode? */

extern gboolean screen_showing_desktop; /*! The support window also used for focus and stacking */ extern Window screen_support_win; +/*! The last time at which the user changed desktops */ +extern Time screen_desktop_user_time; typedef struct DesktopLayout { ObOrientation orientation;