From ad8e8d4988b515ff690564588983eeedf3f238f4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 25 May 2007 15:41:14 +0000 Subject: [PATCH] less negatives means less confusing.. but yeah. get rid of omnipresent check in focus_fallback --- openbox/focus.c | 11 ----------- openbox/screen.c | 9 +++++---- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/openbox/focus.c b/openbox/focus.c index 0f9f2f1b..fad53e92 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -110,17 +110,6 @@ static ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old) return c; } - ob_debug_type(OB_DEBUG_FOCUS, "trying omnipresentness\n"); - if (allow_refocus && old && - old->desktop == DESKTOP_ALL && - client_normal(old) && - client_focus(old)) - { - ob_debug_type(OB_DEBUG_FOCUS, "found in omnipresentness\n"); - return old; - } - - ob_debug_type(OB_DEBUG_FOCUS, "trying the focus order\n"); for (it = focus_order; it; it = g_list_next(it)) { c = it->data; diff --git a/openbox/screen.c b/openbox/screen.c index 2e8965e2..381753ae 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -530,16 +530,17 @@ void screen_set_desktop(guint num, gboolean dofocus) } } + if (focus_client && (focus_client->desktop == DESKTOP_ALL || + focus_client->desktop == screen_desktop)) + dofocus = FALSE; + /* have to try focus here because when you leave an empty desktop there is no focus out to watch for do this before hiding the windows so if helper windows are coming with us, they don't get hidden */ - if (dofocus - && (!focus_client || (focus_client->desktop != DESKTOP_ALL - && focus_client->desktop != num)) - && (c = focus_fallback(TRUE))) + if (dofocus && (c = focus_fallback(TRUE))) { /* only do the flicker reducing stuff ahead of time if we are going to call xsetinputfocus on the window ourselves. otherwise there is -- 2.44.0