diff options
| author | Dana Jansens <danakj@orodu.net> | 2009-12-18 11:39:56 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2009-12-18 11:39:56 -0500 |
| commit | 965ed8907a5dd81d5ffbc93b67a672fa78833854 (patch) | |
| tree | 9e02aed49fd664e5d5b73e417d4a2b5b73e793a3 /openbox | |
| parent | aeac6294a3c45c10d04f108a6fc767298132735c (diff) | |
| parent | 01fd9f99cc5cbe4783a7b7807b51b87269250212 (diff) | |
Merge branch 'backport' into work
Conflicts:
openbox/screen.c
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/event.c | 3 | ||||
| -rw-r--r-- | openbox/focus_cycle.c | 8 | ||||
| -rw-r--r-- | openbox/focus_cycle_popup.c | 14 | ||||
| -rw-r--r-- | openbox/focus_cycle_popup.h | 3 | ||||
| -rw-r--r-- | openbox/screen.c | 24 |
5 files changed, 35 insertions, 17 deletions
diff --git a/openbox/event.c b/openbox/event.c index 1caa8acc..63f23ff9 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1948,9 +1948,6 @@ static gboolean focus_delay_func(gpointer data) ObFocusDelayData *d = data; Time old = event_curtime; - /* don't move focus and kill the menu or the move/resize */ - if (menu_frame_visible || moveresize_in_progress) return FALSE; - event_curtime = d->time; event_curserial = d->serial; if (client_focus(d->client) && config_focus_raise) diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index d5654b3d..a616db64 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -55,12 +55,8 @@ void focus_cycle_stop(ObClient *ifclient) /* stop focus cycling if the given client is a valid focus target, and so the cycling is being disrupted */ if (focus_cycle_target && ifclient && - focus_valid_target(ifclient, TRUE, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows, - FALSE)) + (ifclient == focus_cycle_target || + focus_cycle_popup_is_showing(ifclient))) { focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE); focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index d6d5584c..cc2b3b36 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -735,3 +735,17 @@ void focus_cycle_popup_single_hide(void) { icon_popup_hide(single_popup); } + +gboolean focus_cycle_popup_is_showing(ObClient *client) +{ + if (popup.mapped) { + GList *it; + + for (it = popup.targets; it; it = g_list_next(it)) { + ObFocusCyclePopupTarget *t = it->data; + if (t->client == client) + return TRUE; + } + } + return FALSE; +} diff --git a/openbox/focus_cycle_popup.h b/openbox/focus_cycle_popup.h index c289be36..ad76491d 100644 --- a/openbox/focus_cycle_popup.h +++ b/openbox/focus_cycle_popup.h @@ -46,4 +46,7 @@ void focus_cycle_popup_single_show(struct _ObClient *c, gboolean desktop_windows); void focus_cycle_popup_single_hide(void); +/*! Returns TRUE if the popup is showing the client, otherwise FALSE. */ +gboolean focus_cycle_popup_is_showing(struct _ObClient *client); + #endif diff --git a/openbox/screen.c b/openbox/screen.c index aabed214..bb98e084 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -30,6 +30,7 @@ #include "frame.h" #include "event.h" #include "focus.h" +#include "focus_cycle.h" #include "popup.h" #include "render/render.h" #include "gettext.h" @@ -703,14 +704,21 @@ void screen_set_desktop(guint num, gboolean dofocus) for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; - if (client_hide(c) && c == focus_client) { - /* c was focused and we didn't do fallback clearly so make sure - openbox doesnt still consider the window focused. - this happens when using NextWindow with allDesktops, since - it doesnt want to move focus on desktop change, but the - focus is not going to stay with the current window, which - has now disappeared */ - focus_set_client(NULL); + if (client_hide(c)) { + /* in the middle of cycling..? kill it. */ + focus_cycle_stop(c); + + if (c == focus_client) { + /* c was focused and we didn't do fallback clearly so make + sure openbox doesnt still consider the window focused. + this happens when using NextWindow with allDesktops, + since it doesnt want to move focus on desktop change, + but the focus is not going to stay with the current + window, which has now disappeared. + only do this if the client was actually hidden, + otherwise it can keep focus. */ + focus_set_client(NULL); + } } } } |
