don't change focus order unless the user specifically focuses a window

This commit is contained in:
markt 2007-01-13 19:24:35 +00:00
parent fa2519525a
commit 16743aad06
5 changed files with 18 additions and 7 deletions

View file

@ -1,5 +1,8 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*07/01/13:
* Only change focus order when user specifically focuses a window (Mark)
Screen.cc Window.cc FocusControl.cc/hh
*07/01/11:
* Added option to :Minimize key command to lower all windows in the same
layer as the focused window -- syntax is `:Minimize (layer)' (Mark)

View file

@ -39,6 +39,7 @@ using std::string;
WinClient *FocusControl::s_focused_window = 0;
FluxboxWindow *FocusControl::s_focused_fbwindow = 0;
bool FocusControl::s_reverting = false;
FocusControl::FocusControl(BScreen &screen):
m_screen(screen),
@ -242,7 +243,7 @@ void FocusControl::setScreenFocusedWindow(WinClient &win_client) {
// raise newly focused window to the top of the focused list
// don't change the order if we're cycling or shutting down
if (!m_cycling_focus && !win_client.screen().isShuttingdown()) {
if (!isCycling() && !m_screen.isShuttingdown() && !s_reverting) {
m_focused_list.remove(&win_client);
m_focused_list.push_front(&win_client);
m_cycling_window = m_focused_list.begin();
@ -396,6 +397,8 @@ void FocusControl::revertFocus(BScreen &screen) {
if (screen.focusControl().isCycling())
return;
FocusControl::s_reverting = true;
WinClient *next_focus =
screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID());
@ -412,6 +415,8 @@ void FocusControl::revertFocus(BScreen &screen) {
break;
}
}
FocusControl::s_reverting = false;
}
/*

View file

@ -127,6 +127,7 @@ private:
static WinClient *s_focused_window;
static FluxboxWindow *s_focused_fbwindow;
static bool s_reverting;
};
#endif // FOCUSCONTROL_HH

View file

@ -1129,7 +1129,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
currentWorkspace()->showAll();
if (focused && (focused->isStuck() || focused->isMoving()))
if (focused && focused->isMoving())
focused->setInputFocus();
else
FocusControl::revertFocus(*this);

View file

@ -1053,7 +1053,8 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
if (client.fbwindow() != this)
return false;
m_screen.focusControl().setScreenFocusedWindow(client);
if (&client != m_client)
m_screen.focusControl().setScreenFocusedWindow(client);
m_client = &client;
m_client->raise();
m_client->focusSig().notify();
@ -1432,6 +1433,11 @@ bool FluxboxWindow::setInputFocus() {
if (! m_client->validateClient())
return false;
// this needs to be here rather than setFocusFlag because
// FocusControl::revertFocus will return before FocusIn events arrive
m_screen.focusControl().setScreenFocusedWindow(*m_client);
#ifdef DEBUG
cerr<<"FluxboxWindow::"<<__FUNCTION__<<" isModal() = "<<m_client->isModal()<<endl;
cerr<<"FluxboxWindow::"<<__FUNCTION__<<" transient size = "<<m_client->transients.size()<<endl;
@ -2124,10 +2130,6 @@ void FluxboxWindow::setFocusFlag(bool focus) {
#ifdef DEBUG
cerr<<"FluxboxWindow("<<title()<<")::setFocusFlag("<<focus<<")"<<endl;
#endif // DEBUG
// Record focus timestamp for window cycling enhancements
if (focused) {
screen().focusControl().setScreenFocusedWindow(*m_client);
}
installColormap(focus);