opening window on different workspace should put it at front of focused list with focusnew

This commit is contained in:
markt 2007-01-26 17:21:44 +00:00
parent 46fff8bf34
commit e35670d4a6
4 changed files with 19 additions and 5 deletions

View file

@ -1,5 +1,10 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*07/01/26:
* Opening a window on a different workspace with Focus New Windows enabled
should focus the window when you get to that workspace -- as a free bonus,
stacking order should be more stable on fluxbox restart (Mark)
Screen.cc FocusControl.cc/hh
*07/01/25:
* Don't raise any windows above OverrideRedirect windows, otherwise they
eventually get pushed to the bottomm, bug #1447583 (Mark)

View file

@ -149,6 +149,11 @@ void FocusControl::addFocusBack(WinClient &client) {
m_creation_order_list.push_back(&client);
}
void FocusControl::addFocusFront(WinClient &client) {
m_focused_list.push_front(&client);
m_creation_order_list.push_back(&client);
}
// move all clients in given window to back of focused list
void FocusControl::setFocusBack(FluxboxWindow *fbwin) {
// do nothing if there are no windows open
@ -375,8 +380,9 @@ void FocusControl::removeClient(WinClient &client) {
}
void FocusControl::shutdown() {
FocusedWindows::iterator it = m_focused_list.begin();
for (; it != m_focused_list.end(); ++it) {
// restore windows backwards so they get put back correctly on restart
FocusedWindows::reverse_iterator it = m_focused_list.rbegin();
for (; it != m_focused_list.rend(); ++it) {
if (*it && (*it)->fbwindow())
(*it)->fbwindow()->restore(*it, true);
}

View file

@ -85,6 +85,7 @@ public:
bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
bool isCycling() const { return m_cycling_focus; }
void addFocusBack(WinClient &client);
void addFocusFront(WinClient &client);
void setFocusBack(FluxboxWindow *fbwin);
FocusModel focusModel() const { return *m_focus_model; }

View file

@ -1403,9 +1403,11 @@ FluxboxWindow *BScreen::createWindow(Window client) {
}
}
// always put on end of focused list, if it gets focused it'll get pushed up
// there is only the one win client at this stage
focusControl().addFocusBack(*winclient);
// add the window to the focus list
if (focusControl().focusNew())
focusControl().addFocusFront(*winclient);
else
focusControl().addFocusBack(*winclient);
// we also need to check if another window expects this window to the left
// and if so, then join it.