summaryrefslogtreecommitdiff
path: root/openbox/focus_cycle.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-01-11 11:02:48 -0500
committerDana Jansens <danakj@orodu.net>2010-01-11 11:04:27 -0500
commitd3a01a40f35cb3ae6c5ad8329291e86e2e599691 (patch)
treee2a43e40df31190a0d5baa11bb7a2c0260dfcf62 /openbox/focus_cycle.c
parent9cf5903e16c68ce1877d8d04ca6ee1c28e04a5ce (diff)
If a window is added to the focus order while focus cycling, stop the focus cycling istead of crashing (See bug #4411)
Diffstat (limited to 'openbox/focus_cycle.c')
-rw-r--r--openbox/focus_cycle.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c
index c92b5a54..5849d7d6 100644
--- a/openbox/focus_cycle.c
+++ b/openbox/focus_cycle.c
@@ -55,10 +55,18 @@ 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 && (ifclient == focus_cycle_target ||
- focus_cycle_popup_is_showing(ifclient))) ||
- !ifclient))
+ if (focus_cycle_target && ifclient &&
+ /* shortcut check, it is what we are pointing at right now */
+ (ifclient == focus_cycle_target ||
+ /* it's shown but it shouldn't be anymore */
+ focus_cycle_popup_is_showing(ifclient) ||
+ /* it's not shown but it should be */
+ focus_valid_target(ifclient, TRUE,
+ focus_cycle_iconic_windows,
+ focus_cycle_all_desktops,
+ focus_cycle_dock_windows,
+ focus_cycle_desktop_windows,
+ FALSE)))
{
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE);
focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);