re-fixing the focus after fixing the crash bug
markt markt
4 files changed,
14 insertions(+),
23 deletions(-)
M
src/FocusControl.cc
→
src/FocusControl.cc
@@ -458,18 +458,8 @@ cerr<<"------------------"<<endl;
#endif // DEBUG // Update the old focused client to non focus - // check if s_focused_window is valid - if (s_focused_window != 0 && - Fluxbox::instance()->validateClient(s_focused_window)) { - - if (!client && s_focused_fbwindow) - s_focused_fbwindow->setFocusFlag(false); - - } else { - s_focused_window = 0; - s_focused_fbwindow = 0; - } - + if (s_focused_fbwindow) + s_focused_fbwindow->setFocusFlag(false); if (client && client->fbwindow() && !client->fbwindow()->isIconic()) { // screen should be ok
M
src/Screen.cc
→
src/Screen.cc
@@ -1365,11 +1365,10 @@ }
// 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); if (focusControl().focusNew()) - focusControl().addFocusFront(*winclient); - else - focusControl().addFocusBack(*winclient); - + FocusControl::setFocusedWindow(winclient); + // we also need to check if another window expects this window to the left // and if so, then join it. FluxboxWindow *otherwin = 0;@@ -1406,6 +1405,9 @@ if (!win->isManaged()) {
delete win; return 0; } + + if (focusControl().focusNew() || FocusControl::focusedWindow() == &client) + FocusControl::setFocusedWindow(&client); m_clientlist_sig.notify();
M
src/Window.cc
→
src/Window.cc
@@ -703,11 +703,9 @@ m_statesig.notify();
m_workspacesig.notify(); m_layersig.notify(); - if (was_focused != 0) { + if (was_focused != 0) // already has focus, we're just assuming the state of the old window - setCurrentClient(*was_focused, false); - frame().setFocus(true); - } + FocusControl::setFocusedWindow(&client); frame().reconfigure();@@ -776,10 +774,8 @@ if (numClients() <= 1)
return; WinClient &client = *m_client; detachClient(*m_client); - if (client.fbwindow() != 0) { + if (client.fbwindow() != 0) client.fbwindow()->show(); - FocusControl::setFocusedWindow(&client); - } } /// removes client from client list, does not create new fluxboxwindow for it