From 667d4d301441cb3ef7fdb189d383da084fb80b23 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 20 Aug 2007 14:32:03 +0000 Subject: fix problems with focus order when changing workspaces --- src/FocusControl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 47a0a71..6ccc9a1 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -488,13 +488,16 @@ void FocusControl::revertFocus(BScreen &screen) { if (s_reverting || screen.isShuttingdown()) return; - FocusControl::s_reverting = true; - Focusable *next_focus = screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID()); + if (next_focus && next_focus->fbwindow() && + next_focus->fbwindow()->isStuck()) + FocusControl::s_reverting = true; + // if setting focus fails, or isn't possible, fallback correctly if (!(next_focus && next_focus->focus())) { + setFocusedWindow(0); // so we don't get dangling m_focused_window pointer // if there's a menu open, focus it if (FbTk::Menu::shownMenu()) -- cgit v0.11.2