diff options
author | markt <markt> | 2007-01-26 17:21:44 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-26 17:21:44 (GMT) |
commit | e35670d4a6a1ace394ff13cae39e41c2171b9054 (patch) | |
tree | 528bfabe69f61f2e664bb111661b90d2de9e8b94 /src | |
parent | 46fff8bf344b31c2b4e0f777312bfad22a6fcd26 (diff) | |
download | fluxbox_paul-e35670d4a6a1ace394ff13cae39e41c2171b9054.zip fluxbox_paul-e35670d4a6a1ace394ff13cae39e41c2171b9054.tar.bz2 |
opening window on different workspace should put it at front of focused list with focusnew
Diffstat (limited to 'src')
-rw-r--r-- | src/FocusControl.cc | 10 | ||||
-rw-r--r-- | src/FocusControl.hh | 1 | ||||
-rw-r--r-- | src/Screen.cc | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 61d6e87..21c243d 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc | |||
@@ -149,6 +149,11 @@ void FocusControl::addFocusBack(WinClient &client) { | |||
149 | m_creation_order_list.push_back(&client); | 149 | m_creation_order_list.push_back(&client); |
150 | } | 150 | } |
151 | 151 | ||
152 | void FocusControl::addFocusFront(WinClient &client) { | ||
153 | m_focused_list.push_front(&client); | ||
154 | m_creation_order_list.push_back(&client); | ||
155 | } | ||
156 | |||
152 | // move all clients in given window to back of focused list | 157 | // move all clients in given window to back of focused list |
153 | void FocusControl::setFocusBack(FluxboxWindow *fbwin) { | 158 | void FocusControl::setFocusBack(FluxboxWindow *fbwin) { |
154 | // do nothing if there are no windows open | 159 | // do nothing if there are no windows open |
@@ -375,8 +380,9 @@ void FocusControl::removeClient(WinClient &client) { | |||
375 | } | 380 | } |
376 | 381 | ||
377 | void FocusControl::shutdown() { | 382 | void FocusControl::shutdown() { |
378 | FocusedWindows::iterator it = m_focused_list.begin(); | 383 | // restore windows backwards so they get put back correctly on restart |
379 | for (; it != m_focused_list.end(); ++it) { | 384 | FocusedWindows::reverse_iterator it = m_focused_list.rbegin(); |
385 | for (; it != m_focused_list.rend(); ++it) { | ||
380 | if (*it && (*it)->fbwindow()) | 386 | if (*it && (*it)->fbwindow()) |
381 | (*it)->fbwindow()->restore(*it, true); | 387 | (*it)->fbwindow()->restore(*it, true); |
382 | } | 388 | } |
diff --git a/src/FocusControl.hh b/src/FocusControl.hh index d38ede0..ee5fe95 100644 --- a/src/FocusControl.hh +++ b/src/FocusControl.hh | |||
@@ -85,6 +85,7 @@ public: | |||
85 | bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; } | 85 | bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; } |
86 | bool isCycling() const { return m_cycling_focus; } | 86 | bool isCycling() const { return m_cycling_focus; } |
87 | void addFocusBack(WinClient &client); | 87 | void addFocusBack(WinClient &client); |
88 | void addFocusFront(WinClient &client); | ||
88 | void setFocusBack(FluxboxWindow *fbwin); | 89 | void setFocusBack(FluxboxWindow *fbwin); |
89 | 90 | ||
90 | FocusModel focusModel() const { return *m_focus_model; } | 91 | FocusModel focusModel() const { return *m_focus_model; } |
diff --git a/src/Screen.cc b/src/Screen.cc index 30cc4d3..7c0bed9 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1403,9 +1403,11 @@ FluxboxWindow *BScreen::createWindow(Window client) { | |||
1403 | } | 1403 | } |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | // always put on end of focused list, if it gets focused it'll get pushed up | 1406 | // add the window to the focus list |
1407 | // there is only the one win client at this stage | 1407 | if (focusControl().focusNew()) |
1408 | focusControl().addFocusBack(*winclient); | 1408 | focusControl().addFocusFront(*winclient); |
1409 | else | ||
1410 | focusControl().addFocusBack(*winclient); | ||
1409 | 1411 | ||
1410 | // we also need to check if another window expects this window to the left | 1412 | // we also need to check if another window expects this window to the left |
1411 | // and if so, then join it. | 1413 | // and if so, then join it. |