aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 383de61..2dbf289 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -76,6 +76,11 @@ FocusControl::FocusControl(BScreen &screen):
76 m_focus_new(screen.resourceManager(), true, 76 m_focus_new(screen.resourceManager(), true,
77 screen.name()+".focusNewWindows", 77 screen.name()+".focusNewWindows",
78 screen.altName()+".FocusNewWindows"), 78 screen.altName()+".FocusNewWindows"),
79#ifdef XINERAMA
80 m_focus_same_head(screen.resourceManager(), false,
81 screen.name()+".focusSameHead",
82 screen.altName()+".FocusSameHead"),
83#endif // XINERAMA
79 m_focused_list(screen), m_creation_order_list(screen), 84 m_focused_list(screen), m_creation_order_list(screen),
80 m_focused_win_list(screen), m_creation_order_win_list(screen), 85 m_focused_win_list(screen), m_creation_order_win_list(screen),
81 m_cycling_list(0), 86 m_cycling_list(0),
@@ -251,11 +256,18 @@ Focusable *FocusControl::lastFocusedWindow(int workspace) {
251 if (workspace < 0 || workspace >= (int) m_screen.numberOfWorkspaces()) 256 if (workspace < 0 || workspace >= (int) m_screen.numberOfWorkspaces())
252 return m_focused_list.clientList().front(); 257 return m_focused_list.clientList().front();
253 258
259#ifdef XINERAMA
260 int cur_head = focusSameHead() ? m_screen.getCurrHead() : (-1);
261#endif // XINERAMA
262
254 Focusables::iterator it = m_focused_list.clientList().begin(); 263 Focusables::iterator it = m_focused_list.clientList().begin();
255 Focusables::iterator it_end = m_focused_list.clientList().end(); 264 Focusables::iterator it_end = m_focused_list.clientList().end();
256 for (; it != it_end; ++it) { 265 for (; it != it_end; ++it) {
257 if ((*it)->fbwindow() && (*it)->acceptsFocus() && 266 if ((*it)->fbwindow() && (*it)->acceptsFocus() &&
258 (*it)->fbwindow()->winClient().validateClient() && 267 (*it)->fbwindow()->winClient().validateClient() &&
268#ifdef XINERAMA
269 ( (cur_head == -1) || ((*it)->fbwindow()->getOnHead() == cur_head) ) &&
270#endif // XINERAMA
259 ((((int)(*it)->fbwindow()->workspaceNumber()) == workspace || 271 ((((int)(*it)->fbwindow()->workspaceNumber()) == workspace ||
260 (*it)->fbwindow()->isStuck()) && !(*it)->fbwindow()->isIconic())) 272 (*it)->fbwindow()->isStuck()) && !(*it)->fbwindow()->isIconic()))
261 return *it; 273 return *it;