diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-13 00:47:40 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-13 00:47:40 (GMT) |
commit | b302dab2f187e364df36237c44b8e48f1e892f04 (patch) | |
tree | 207955232ddf7aef1b4a13ccb5ae85a2404aa509 /src/FocusControl.cc | |
parent | f66d446a94450d509748afe28a95f48b8fdfcfc5 (diff) | |
download | fluxbox_pavel-b302dab2f187e364df36237c44b8e48f1e892f04.zip fluxbox_pavel-b302dab2f187e364df36237c44b8e48f1e892f04.tar.bz2 |
fix some issues with reverting focus
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r-- | src/FocusControl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc index a81d68f..c17b900 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc | |||
@@ -45,6 +45,7 @@ using std::string; | |||
45 | 45 | ||
46 | WinClient *FocusControl::s_focused_window = 0; | 46 | WinClient *FocusControl::s_focused_window = 0; |
47 | FluxboxWindow *FocusControl::s_focused_fbwindow = 0; | 47 | FluxboxWindow *FocusControl::s_focused_fbwindow = 0; |
48 | WinClient *FocusControl::s_expecting_focus = 0; | ||
48 | bool FocusControl::s_reverting = false; | 49 | bool FocusControl::s_reverting = false; |
49 | 50 | ||
50 | namespace { | 51 | namespace { |
@@ -242,7 +243,7 @@ void FocusControl::stopCyclingFocus() { | |||
242 | * is given. | 243 | * is given. |
243 | */ | 244 | */ |
244 | Focusable *FocusControl::lastFocusedWindow(int workspace) { | 245 | Focusable *FocusControl::lastFocusedWindow(int workspace) { |
245 | if (m_focused_list.empty() || m_screen.isShuttingdown()) return 0; | 246 | if (m_screen.isShuttingdown()) return 0; |
246 | if (workspace < 0 || workspace >= (int) m_screen.numberOfWorkspaces()) | 247 | if (workspace < 0 || workspace >= (int) m_screen.numberOfWorkspaces()) |
247 | return m_focused_list.clientList().front(); | 248 | return m_focused_list.clientList().front(); |
248 | 249 | ||
@@ -250,6 +251,7 @@ Focusable *FocusControl::lastFocusedWindow(int workspace) { | |||
250 | Focusables::iterator it_end = m_focused_list.clientList().end(); | 251 | Focusables::iterator it_end = m_focused_list.clientList().end(); |
251 | for (; it != it_end; ++it) { | 252 | for (; it != it_end; ++it) { |
252 | if ((*it)->fbwindow() && (*it)->acceptsFocus() && | 253 | if ((*it)->fbwindow() && (*it)->acceptsFocus() && |
254 | (*it)->fbwindow()->winClient().validateClient() && | ||
253 | ((((int)(*it)->fbwindow()->workspaceNumber()) == workspace || | 255 | ((((int)(*it)->fbwindow()->workspaceNumber()) == workspace || |
254 | (*it)->fbwindow()->isStuck()) && !(*it)->fbwindow()->isIconic())) | 256 | (*it)->fbwindow()->isStuck()) && !(*it)->fbwindow()->isIconic())) |
255 | return *it; | 257 | return *it; |
@@ -536,6 +538,7 @@ void FocusControl::setFocusedWindow(WinClient *client) { | |||
536 | // screen should be ok | 538 | // screen should be ok |
537 | s_focused_fbwindow = client->fbwindow(); | 539 | s_focused_fbwindow = client->fbwindow(); |
538 | s_focused_window = client; // update focused window | 540 | s_focused_window = client; // update focused window |
541 | s_expecting_focus = 0; | ||
539 | s_focused_fbwindow->setCurrentClient(*client, | 542 | s_focused_fbwindow->setCurrentClient(*client, |
540 | false); // don't set inputfocus | 543 | false); // don't set inputfocus |
541 | s_focused_fbwindow->setFocusFlag(true); // set focus flag | 544 | s_focused_fbwindow->setFocusFlag(true); // set focus flag |