all repos — fluxbox @ 84ca1f2e2f82b66b417b8e25295e37cb07985f3d

custom fork of the fluxbox windowmanager

re-fixing the focus after fixing the crash bug
markt markt
commit

84ca1f2e2f82b66b417b8e25295e37cb07985f3d

parent

b407e121badd48b0fd3fdfe2e47a5ac3bfa7f047

4 files changed, 14 insertions(+), 23 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.0rc3: +*06/07/06: + * Still trying to get the focus right: bug #1517750 (Mark) + FocusControl.cc Window.cc Screen.cc *06/07/05: * Fix crash on startup on some platforms (Simon) FbTk/FbString.cc
M src/FocusControl.ccsrc/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.ccsrc/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.ccsrc/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