properly revert focus when two windows close at the same time
This commit is contained in:
parent
f4d1af1208
commit
f9ade8947c
6 changed files with 19 additions and 6 deletions
|
@ -1,5 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0rc3:
|
Changes for 1.0rc3:
|
||||||
|
*06/07/20:
|
||||||
|
* Properly revert focus when two windows close simultaneously (Mark)
|
||||||
|
WinClient.cc/hh FbTk/FbWindow.hh fluxbox.cc Window.cc
|
||||||
*06/07/19:
|
*06/07/19:
|
||||||
* Preserve order of focused windows on restart (Mark)
|
* Preserve order of focused windows on restart (Mark)
|
||||||
Workspace.cc Screen.cc FocusControl.cc/hh
|
Workspace.cc Screen.cc FocusControl.cc/hh
|
||||||
|
|
|
@ -137,7 +137,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual void lower();
|
virtual void lower();
|
||||||
virtual void raise();
|
virtual void raise();
|
||||||
void setInputFocus(int revert_to, int time);
|
virtual void setInputFocus(int revert_to, int time);
|
||||||
/// defines a cursor for this window
|
/// defines a cursor for this window
|
||||||
void setCursor(Cursor cur);
|
void setCursor(Cursor cur);
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
|
|
|
@ -66,6 +66,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb
|
||||||
m_modal(0),
|
m_modal(0),
|
||||||
send_focus_message(false),
|
send_focus_message(false),
|
||||||
send_close_message(false),
|
send_close_message(false),
|
||||||
|
m_waiting_focus(false),
|
||||||
m_win_gravity(0),
|
m_win_gravity(0),
|
||||||
m_title(""), m_icon_title(""),
|
m_title(""), m_icon_title(""),
|
||||||
m_class_name(""), m_instance_name(""),
|
m_class_name(""), m_instance_name(""),
|
||||||
|
@ -188,6 +189,11 @@ bool WinClient::sendFocus() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WinClient::setInputFocus(int revert_to, int time) {
|
||||||
|
FbTk::FbWindow::setInputFocus(revert_to, time);
|
||||||
|
m_waiting_focus = true;
|
||||||
|
}
|
||||||
|
|
||||||
void WinClient::sendClose(bool forceful) {
|
void WinClient::sendClose(bool forceful) {
|
||||||
if (forceful || !send_close_message)
|
if (forceful || !send_close_message)
|
||||||
XKillClient(display(), window());
|
XKillClient(display(), window());
|
||||||
|
|
|
@ -53,6 +53,9 @@ public:
|
||||||
bool sendFocus(); // returns whether we sent a message or not
|
bool sendFocus(); // returns whether we sent a message or not
|
||||||
// i.e. whether we assume the focus will get taken
|
// i.e. whether we assume the focus will get taken
|
||||||
bool acceptsFocus() const; // will this window accept focus (according to hints)
|
bool acceptsFocus() const; // will this window accept focus (according to hints)
|
||||||
|
void setInputFocus(int revert_to, int time);
|
||||||
|
inline bool isWaitingFocus() { return m_waiting_focus; }
|
||||||
|
void receivedFocus() { m_waiting_focus = false; m_focussig.notify(); }
|
||||||
void sendClose(bool forceful = false);
|
void sendClose(bool forceful = false);
|
||||||
// not aware of anything that makes this false at present
|
// not aware of anything that makes this false at present
|
||||||
inline bool isClosable() const { return true; }
|
inline bool isClosable() const { return true; }
|
||||||
|
@ -197,6 +200,7 @@ private:
|
||||||
// or indicates that we are modal if don't have any transients
|
// or indicates that we are modal if don't have any transients
|
||||||
int m_modal;
|
int m_modal;
|
||||||
bool send_focus_message, send_close_message;
|
bool send_focus_message, send_close_message;
|
||||||
|
bool m_waiting_focus;
|
||||||
|
|
||||||
int m_win_gravity;
|
int m_win_gravity;
|
||||||
|
|
||||||
|
|
|
@ -2112,7 +2112,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
|
||||||
if (was_focused != focus) {
|
if (was_focused != focus) {
|
||||||
m_focussig.notify();
|
m_focussig.notify();
|
||||||
if (m_client)
|
if (m_client)
|
||||||
m_client->focusSig().notify();
|
m_client->receivedFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1297,12 +1297,12 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
|
||||||
|
|
||||||
// This is where we revert focus on window close
|
// This is where we revert focus on window close
|
||||||
// NOWHERE ELSE!!!
|
// NOWHERE ELSE!!!
|
||||||
if (FocusControl::focusedWindow() == &client)
|
if (FocusControl::focusedWindow() == &client) {
|
||||||
FocusControl::unfocusWindow(client);
|
FocusControl::unfocusWindow(client);
|
||||||
|
// make sure nothing else uses this window before focus reverts
|
||||||
// failed to revert focus?
|
|
||||||
if (FocusControl::focusedWindow() == &client)
|
|
||||||
FocusControl::setFocusedWindow(0);
|
FocusControl::setFocusedWindow(0);
|
||||||
|
} else if (!FocusControl::focusedWindow() && client.isWaitingFocus())
|
||||||
|
FocusControl::revertFocus(screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue