From 7f36e21ea9d86df5e6fa62d2888891ed957c4639 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 24 Nov 2009 19:36:18 -0500 Subject: Combine the Exit and SessionLogout actions Just "do the right thing" based on if you are connected to a session manager or not. --- openbox/actions/all.c | 1 - openbox/actions/all.h | 1 - openbox/actions/exit.c | 26 +++++++++++++--- openbox/actions/session.c | 78 ----------------------------------------------- openbox/session.c | 6 ++++ openbox/session.h | 2 ++ 6 files changed, 29 insertions(+), 85 deletions(-) delete mode 100644 openbox/actions/session.c (limited to 'openbox') diff --git a/openbox/actions/all.c b/openbox/actions/all.c index c86c4281..47141ac6 100644 --- a/openbox/actions/all.c +++ b/openbox/actions/all.c @@ -9,7 +9,6 @@ void action_all_startup(void) action_reconfigure_startup(); action_exit_startup(); action_restart_startup(); - action_session_startup(); action_cyclewindows_startup(); action_breakchroot_startup(); action_close_startup(); diff --git a/openbox/actions/all.h b/openbox/actions/all.h index 4fbd6ff5..5f3f573f 100644 --- a/openbox/actions/all.h +++ b/openbox/actions/all.h @@ -10,7 +10,6 @@ void action_showdesktop_startup(); void action_reconfigure_startup(); void action_exit_startup(); void action_restart_startup(); -void action_session_startup(); void action_cyclewindows_startup(); void action_breakchroot_startup(); void action_close_startup(); diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index 875a181a..567926e1 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -1,6 +1,7 @@ #include "openbox/actions.h" #include "openbox/openbox.h" #include "openbox/prompt.h" +#include "openbox/session.h" #include "gettext.h" typedef struct { @@ -13,6 +14,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); void action_exit_startup(void) { actions_register("Exit", setup_func, NULL, run_func, NULL, NULL); + actions_register("SessionLogout", setup_func, NULL, run_func, NULL, NULL); } static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) @@ -29,10 +31,18 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } +static void do_exit(void) +{ + if (session_connected()) + session_request_logout(FALSE); + else + ob_exit(0); +} + static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data) { if (result) - ob_exit(0); + do_exit(); return TRUE; /* call the cleanup func */ } @@ -53,13 +63,19 @@ static gboolean run_func(ObActionsData *data, gpointer options) { _("Exit"), 1 } }; - p = prompt_new(_("Are you sure you want to exit Openbox?"), - _("Exit Openbox"), - answers, 2, 0, 0, prompt_cb, prompt_cleanup, NULL); + if (session_connected()) + p = prompt_new(_("Are you sure you want to log out?"), + _("Log Out"), + answers, 2, 0, 0, prompt_cb, prompt_cleanup, NULL); + else + p = prompt_new(_("Are you sure you want to exit Openbox?"), + _("Exit Openbox"), + answers, 2, 0, 0, prompt_cb, prompt_cleanup, NULL); + prompt_show(p, NULL, FALSE); } else - ob_exit(0); + do_exit(); return FALSE; } diff --git a/openbox/actions/session.c b/openbox/actions/session.c deleted file mode 100644 index 04ba96cb..00000000 --- a/openbox/actions/session.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "openbox/actions.h" -#include "openbox/prompt.h" -#include "openbox/session.h" -#include "gettext.h" - -typedef struct { - gboolean prompt; - gboolean silent; -} Options; - -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static gboolean logout_func(ObActionsData *data, gpointer options); - -void action_session_startup(void) -{ - actions_register("SessionLogout", setup_func, NULL, logout_func, - NULL, NULL); -} - -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) -{ - xmlNodePtr n; - Options *o; - - o = g_new0(Options, 1); - o->prompt = TRUE; - - if ((n = parse_find_node("prompt", node))) - o->prompt = parse_bool(doc, n); - - return o; -} - -static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data) -{ - Options *o = data; - if (result) { -#ifdef USE_SM - session_request_logout(o->silent); -#else - /* TRANSLATORS: Don't translate the word "SessionLogout" as it's the - name of the action you write in rc.xml */ - g_message(_("The SessionLogout action is not available since Openbox was built without session management support")); -#endif - } - return TRUE; /* call cleanup func */ -} - -static void prompt_cleanup(ObPrompt *p, gpointer data) -{ - g_free(data); - prompt_unref(p); -} - -/* Always return FALSE because its not interactive */ -static gboolean logout_func(ObActionsData *data, gpointer options) -{ - Options *o = options; - - if (o->prompt) { - Options *o2; - ObPrompt *p; - ObPromptAnswer answers[] = { - { _("Cancel"), 0 }, - { _("Log Out"), 1 } - }; - - o2 = g_memdup(o, sizeof(Options)); - p = prompt_new(_("Are you sure you want to log out?"), - _("Log Out"), - answers, 2, 0, 0, prompt_cb, prompt_cleanup, o2); - prompt_show(p, NULL, FALSE); - } - else - prompt_cb(NULL, 1, o); - - return FALSE; -} diff --git a/openbox/session.c b/openbox/session.c index 811592ec..14018478 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -34,6 +34,7 @@ void session_startup(gint argc, gchar **argv) {} void session_shutdown(gboolean permanent) {} GList* session_state_find(struct _ObClient *c) { return NULL; } void session_request_logout(gboolean silent) {} +gboolean session_connected(void) { return FALSE; } #else #include "debug.h" @@ -155,6 +156,11 @@ void session_shutdown(gboolean permanent) } } +gboolean session_connected(void) +{ + return !!sm_conn; +} + /*! Connect to the session manager and set up our callback functions */ static gboolean session_connect() { diff --git a/openbox/session.h b/openbox/session.h index e2307a6f..f37e2111 100644 --- a/openbox/session.h +++ b/openbox/session.h @@ -55,4 +55,6 @@ GList* session_state_find(struct _ObClient *c); void session_request_logout(gboolean silent); +gboolean session_connected(void); + #endif -- cgit v1.2.3 From 8237564b4784c69ab50a9291d503850cb6018f67 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 Dec 2009 10:11:21 -0500 Subject: Add needed linebreaks to the end of some debug messages --- openbox/grab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbox') diff --git a/openbox/grab.c b/openbox/grab.c index 214666e5..03e21bdf 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -181,7 +181,7 @@ void grab_button_full(guint button, guint state, Window win, guint mask, pointer_mode, GrabModeAsync, None, ob_cursor(cur)); xerror_set_ignore(FALSE); if (xerror_occured) - ob_debug("Failed to grab button %d modifiers %d", button, state); + ob_debug("Failed to grab button %d modifiers %d\n", button, state); } void ungrab_button(guint button, guint state, Window win) @@ -203,7 +203,7 @@ void grab_key(guint keycode, guint state, Window win, gint keyboard_mode) GrabModeAsync, keyboard_mode); xerror_set_ignore(FALSE); if (xerror_occured) - ob_debug("Failed to grab keycode %d modifiers %d", keycode, state); + ob_debug("Failed to grab keycode %d modifiers %d\n", keycode, state); } void ungrab_all_keys(Window win) -- cgit v1.2.3 From 97890e21cdb23ce3fc31dd1e0ce24537a45cc599 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 Dec 2009 11:11:41 -0500 Subject: Change _net_active_window behaviour. Move focus on _net_active_window "app" requests if focus stealing would be allowed. If focus is not given to the target window and it is hilited (or any other situation where it is hilited) and the window is on another desktop, then also raise it and make it the LRU window, so when you switch desktops you go right to it. --- openbox/client.c | 228 +++++++++++++++++++++++++++++-------------------------- openbox/event.c | 5 +- 2 files changed, 121 insertions(+), 112 deletions(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index efb815e7..6113062b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -106,6 +106,8 @@ static GSList *client_search_all_top_parents_internal(ObClient *self, 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); void client_startup(gboolean reconfig) { @@ -499,115 +501,13 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s\n", activate ? "yes" : "no"); if (activate) { - gboolean raise = FALSE; - gboolean relative_focused; - gboolean parent_focused; - - parent_focused = (focus_client != NULL && - client_search_focus_parent(self)); - relative_focused = (focus_client != NULL && - (client_search_focus_tree_full(self) != NULL || - client_search_focus_group_full(self) != NULL)); - - /* This is focus stealing prevention */ - ob_debug_type(OB_DEBUG_FOCUS, - "Want to focus new window 0x%x at time %u " - "launched at %u (last user interaction time %u)\n", - self->window, map_time, launch_time, - event_last_user_time); - - if (menu_frame_visible || moveresize_in_progress) { - activate = FALSE; - raise = TRUE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because the user is inside " - "an Openbox menu or is move/resizing a window and " - "we don't want to interrupt them\n"); - } - - /* if it's on another desktop */ - else if (!(self->desktop == screen_desktop || - self->desktop == DESKTOP_ALL) && - /* the timestamp is from before you changed desktops */ - launch_time && screen_desktop_user_time && - !event_time_after(launch_time, screen_desktop_user_time)) - { - activate = FALSE; - raise = TRUE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because its on another " - "desktop\n"); - } - /* If something is focused... */ - else if (focus_client) { - /* If the user is working in another window right now, then don't - steal focus */ - if (!parent_focused && - event_last_user_time && launch_time && - event_time_after(event_last_user_time, launch_time) && - event_last_user_time != launch_time && - event_time_after(event_last_user_time, - map_time - OB_EVENT_USER_TIME_DELAY)) - { - activate = FALSE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because the user is " - "working in another window that is not " - "its parent\n"); - } - /* If the new window is a transient (and its relatives aren't - focused) */ - else if (client_has_parent(self) && !relative_focused) { - activate = FALSE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because it is a " - "transient, and its relatives aren't focused\n"); - } - /* Don't steal focus from globally active clients. - I stole this idea from KWin. It seems nice. - */ - else if (!(focus_client->can_focus || - focus_client->focus_notify)) - { - activate = FALSE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because a globally " - "active client has focus\n"); - } - /* Don't move focus if it's not going to go to this window - anyway */ - else if (client_focus_target(self) != self) { - activate = FALSE; - raise = TRUE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because another window " - "would get the focus anyway\n"); - } - /* Don't move focus if the window is not visible on the current - desktop and none of its relatives are focused */ - else if (!(self->desktop == screen_desktop || - self->desktop == DESKTOP_ALL) && - !relative_focused) - { - activate = FALSE; - raise = TRUE; - ob_debug_type(OB_DEBUG_FOCUS, - "Not focusing the window because it is on " - "another desktop and no relatives are focused "); - } - } + activate = client_can_steal_focus(self, map_time, launch_time); if (!activate) { - ob_debug_type(OB_DEBUG_FOCUS, - "Focus stealing prevention activated for %s at " - "time %u (last user interaction time %u)\n", - self->title, map_time, event_last_user_time); - /* if the client isn't focused, then hilite it so the user + /* if the client isn't stealing focus, then hilite it so the user knows it is there */ + /* XXX don't do this if we're restoring from a session */ client_hilite(self, TRUE); - /* we may want to raise it even tho we're not activating it */ - if (raise && !client_restore_session_stacking(self)) - stacking_raise(CLIENT_AS_WINDOW(self)); } } else { @@ -858,6 +758,105 @@ void client_fake_unmanage(ObClient *self) g_free(self); } +static gboolean client_can_steal_focus(ObClient *self, Time steal_time, + Time launch_time) +{ + gboolean steal; + gboolean relative_focused; + gboolean parent_focused; + + steal = TRUE; + + parent_focused = (focus_client != NULL && + client_search_focus_parent(self)); + relative_focused = (focus_client != NULL && + (client_search_focus_tree_full(self) != NULL || + client_search_focus_group_full(self) != NULL)); + + /* This is focus stealing prevention */ + ob_debug_type(OB_DEBUG_FOCUS, + "Want to focus new window 0x%x at time %u " + "launched at %u (last user interaction time %u)\n", + self->window, steal_time, launch_time, + event_last_user_time); + + /* 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 && screen_desktop_user_time && + !event_time_after(launch_time, screen_desktop_user_time)) + { + steal = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because its on another " + "desktop\n"); + } + /* If something is focused... */ + else if (focus_client) { + /* If the user is working in another window right now, then don't + steal focus */ + if (!parent_focused && + event_last_user_time && launch_time && + event_time_after(event_last_user_time, launch_time) && + event_last_user_time != launch_time && + event_time_after(event_last_user_time, + steal_time - OB_EVENT_USER_TIME_DELAY)) + { + steal = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because the user is " + "working in another window that is not " + "its parent\n"); + } + /* If the new window is a transient (and its relatives aren't + focused) */ + else if (client_has_parent(self) && !relative_focused) { + steal = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because it is a " + "transient, and its relatives aren't focused\n"); + } + /* Don't steal focus from globally active clients. + I stole this idea from KWin. It seems nice. + */ + else if (!(focus_client->can_focus || + focus_client->focus_notify)) + { + steal = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because a globally " + "active client has focus\n"); + } + /* Don't move focus if it's not going to go to this window + anyway */ + else if (client_focus_target(self) != self) { + steal = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because another window " + "would get the focus anyway\n"); + } + /* Don't move focus if the window is not visible on the current + desktop and none of its relatives are focused */ + else if (!(self->desktop == screen_desktop || + self->desktop == DESKTOP_ALL) && + !relative_focused) + { + steal = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because it is on " + "another desktop and no relatives are focused "); + } + } + + if (!steal) + ob_debug_type(OB_DEBUG_FOCUS, + "Focus stealing prevention activated for %s at " + "time %u (last user interaction time %u)\n", + self->title, steal_time, event_last_user_time); + return steal; +} + /*! Returns a new structure containing the per-app settings for this client. The returned structure needs to be freed with g_free. */ static ObAppSettings *client_get_settings_state(ObClient *self) @@ -3515,8 +3514,18 @@ void client_hilite(ObClient *self, gboolean hilite) /* don't allow focused windows to hilite */ self->demands_attention = hilite && !client_focused(self); if (self->frame != NULL) { /* if we're mapping, just set the state */ - if (self->demands_attention) + if (self->demands_attention) { frame_flash_start(self->frame); + + /* if the window is on another desktop then raise it and make it + the most recently used window */ + if (self->desktop != screen_desktop && + self->desktop != DESKTOP_ALL) + { + stacking_raise(CLIENT_AS_WINDOW(self)); + focus_order_to_top(self); + } + } else frame_flash_stop(self->frame); client_change_state(self); @@ -3929,9 +3938,12 @@ static void client_present(ObClient *self, gboolean here, gboolean raise, void client_activate(ObClient *self, gboolean here, gboolean raise, gboolean unshade, gboolean user) { - if (user || (self->desktop == DESKTOP_ALL || - self->desktop == screen_desktop)) + if ((user && (self->desktop == DESKTOP_ALL || + self->desktop == screen_desktop)) || + client_can_steal_focus(self, event_curtime, CurrentTime)) + { client_present(self, here, raise, unshade); + } else client_hilite(self, TRUE); } diff --git a/openbox/event.c b/openbox/event.c index 71fed413..93c5fa21 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1323,10 +1323,7 @@ static void event_handle_client(ObClient *client, XEvent *e) (e->xclient.data.l[0] == 2 ? "user" : "INVALID")))); /* XXX make use of data.l[2] !? */ if (e->xclient.data.l[0] == 1 || e->xclient.data.l[0] == 2) { - /* don't use the user's timestamp for client_focus, cuz if it's - an old broken timestamp (happens all the time) then focus - won't move even though we're trying to move it - event_curtime = e->xclient.data.l[1];*/ + event_curtime = e->xclient.data.l[1]; if (e->xclient.data.l[1] == 0) ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is" -- cgit v1.2.3 From 11ecb7d2199d06b2929ba7e5d3c92c021038a0cc Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 Dec 2009 11:21:45 -0500 Subject: Don't kill keygrabs when focus moves. Applications should be better behaved by now, and GTK based apps seem to be at least. We can file bug reports with them if we need to still. --- openbox/client.c | 6 ------ openbox/focus.c | 6 ------ 2 files changed, 12 deletions(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index 6113062b..91693f99 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2621,10 +2621,6 @@ gboolean client_hide(ObClient *self) gboolean hide = FALSE; if (!client_should_show(self)) { - if (self == focus_client) { - event_cancel_all_key_grabs(); - } - /* We don't need to ignore enter events here. The window can hide/iconify in 3 different ways: 1 - through an x message. in this case we ignore all enter events @@ -3875,8 +3871,6 @@ gboolean client_focus(ObClient *self) go moving on us */ event_halt_focus_delay(); - event_cancel_all_key_grabs(); - xerror_set_ignore(TRUE); xerror_occured = FALSE; diff --git a/openbox/focus.c b/openbox/focus.c index 63eb2cca..8c3bd70a 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -83,10 +83,6 @@ void focus_set_client(ObClient *client) screen_install_colormap(focus_client, FALSE); screen_install_colormap(client, TRUE); - /* in the middle of cycling..? kill it. */ - focus_cycle_stop(focus_client); - focus_cycle_stop(client); - focus_client = client; if (client != NULL) { @@ -197,8 +193,6 @@ void focus_nothing(void) /* nothing is focused, update the colormap and _the root property_ */ focus_set_client(NULL); - event_cancel_all_key_grabs(); - /* when nothing will be focused, send focus to the backup target */ XSetInputFocus(ob_display, screen_support_win, RevertToPointerRoot, event_curtime); -- cgit v1.2.3 From 07126124c9242a5a20883c3145464730e50afe94 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 Dec 2009 11:32:40 -0500 Subject: Fix client_activate() to work for internal Openbox menus client_activate() is a helpful way to focus a window on another desktop, but only Openbox is allowed to do such things, user messages cannot. --- openbox/client.c | 7 ++++--- openbox/client.h | 6 +++--- openbox/client_list_combined_menu.c | 2 +- openbox/client_list_menu.c | 2 +- openbox/event.c | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index 91693f99..ecb4aafe 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3929,14 +3929,15 @@ static void client_present(ObClient *self, gboolean here, gboolean raise, } /* this function exists to map to the net_active_window message in the ewmh */ -void client_activate(ObClient *self, gboolean here, gboolean raise, +void client_activate(ObClient *self, gboolean desktop, gboolean raise, gboolean unshade, gboolean user) { - if ((user && (self->desktop == DESKTOP_ALL || + if ((user && (desktop || + self->desktop == DESKTOP_ALL || self->desktop == screen_desktop)) || client_can_steal_focus(self, event_curtime, CurrentTime)) { - client_present(self, here, raise, unshade); + client_present(self, FALSE, raise, unshade); } else client_hilite(self, TRUE); diff --git a/openbox/client.h b/openbox/client.h index 832405cf..15ae2220 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -575,14 +575,14 @@ gboolean client_focus(ObClient *self); /*! Activates the client for use, focusing, uniconifying it, etc. To be used when the user deliberately selects a window for use. - @param here If true, then the client is brought to the current desktop; - otherwise, the desktop is changed to where the client lives. + @param desktop If true, and the window is on another desktop, it will still + be activated. @param raise If true, the client is brought to the front. @param unshade If true, the client is unshaded (if it is shaded) @param user If true, then a user action is what requested the activation; otherwise, it means an application requested it on its own */ -void client_activate(ObClient *self, gboolean here, gboolean raise, +void client_activate(ObClient *self, gboolean desktop, gboolean raise, gboolean unshade, gboolean user); /*! Bring all of its helper windows to its desktop. These are the utility and diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index a04d07d6..ad23cd48 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -114,7 +114,7 @@ static void menu_execute(ObMenuEntry *self, ObMenuFrame *f, else { ObClient *t = self->data.normal.data; if (t) { /* it's set to NULL if its destroyed */ - client_activate(t, FALSE, TRUE, TRUE, TRUE); + client_activate(t, TRUE, TRUE, TRUE, TRUE); /* if the window is omnipresent then we need to go to its desktop */ if (t->desktop == DESKTOP_ALL) diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 4ec6e785..ca4534ba 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -101,7 +101,7 @@ static void desk_menu_execute(ObMenuEntry *self, ObMenuFrame *f, { ObClient *t = self->data.normal.data; if (t) { /* it's set to NULL if its destroyed */ - client_activate(t, FALSE, TRUE, TRUE, TRUE); + client_activate(t, TRUE, TRUE, TRUE, TRUE); /* if the window is omnipresent then we need to go to its desktop */ if (t->desktop == DESKTOP_ALL) diff --git a/openbox/event.c b/openbox/event.c index 93c5fa21..e07d6a31 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1332,7 +1332,7 @@ static void event_handle_client(ObClient *client, XEvent *e) ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is " "missing source indication\n", client->title); - client_activate(client, TRUE, TRUE, TRUE, + client_activate(client, FALSE, TRUE, TRUE, (e->xclient.data.l[0] == 0 || e->xclient.data.l[0] == 2)); } else if (msgtype == prop_atoms.net_wm_moveresize) { -- cgit v1.2.3 From 672aea85cfe2ac2bc8cb4e3f34fd023f10d90182 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 Dec 2009 14:16:08 -0500 Subject: Don't hilite new windows when we're restoring them from a saved session. --- openbox/client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index ecb4aafe..a91b9503 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -505,9 +505,10 @@ void client_manage(Window window, ObPrompt *prompt) if (!activate) { /* if the client isn't stealing focus, then hilite it so the user - knows it is there */ - /* XXX don't do this if we're restoring from a session */ - client_hilite(self, TRUE); + knows it is there, but don't do this if we're restoring from a + session */ + if (!client_restore_session_stacking(self)) + client_hilite(self, TRUE); } } else { -- cgit v1.2.3