From 80a7c704df87f72b587749c7c5942f3a5b5661f2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 24 Apr 2007 19:58:50 +0000 Subject: [PATCH] merge r5888-5889 from trunk --- openbox/client.c | 13 ++++++++++++- openbox/screen.c | 4 ++++ openbox/screen.h | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/openbox/client.c b/openbox/client.c index 8098b3dc..51e93c17 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -385,10 +385,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 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 { @@ -3106,6 +3114,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(); diff --git a/openbox/screen.c b/openbox/screen.c index 71748d65..97cab3e6 100644 --- a/openbox/screen.c +++ b/openbox/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 @@ void screen_set_desktop(guint num) } 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) diff --git a/openbox/screen.h b/openbox/screen.h index 970cde34..bedc2e6d 100644 --- a/openbox/screen.h +++ b/openbox/screen.h @@ -38,6 +38,8 @@ extern guint screen_last_desktop; 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; -- 2.34.1