From 99b6dc4e5df2b9a8344de7cf1da102c9245cb014 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sun, 11 May 2003 23:44:09 +0000 Subject: fix up various focus-related issues --- src/Screen.cc | 7 +++++-- src/Window.cc | 9 +++++---- src/fluxbox.cc | 8 ++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index d8c02ef..bb3bf8f 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.156 2003/05/11 17:11:59 fluxgen Exp $ +// $Id: Screen.cc,v 1.157 2003/05/11 23:44:08 rathnor Exp $ #include "Screen.hh" @@ -1270,7 +1270,10 @@ FluxboxWindow *BScreen::createWindow(Window client) { } else { // 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 - focused_list.push_back(&win->winClient()); + if (doFocusNew()) + focused_list.push_front(&win->winClient()); + else + focused_list.push_back(&win->winClient()); //TODO: is next line needed? Fluxbox::instance()->saveWindowSearch(client, win); diff --git a/src/Window.cc b/src/Window.cc index 9b563b0..4410f5a 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.171 2003/05/11 17:14:41 fluxgen Exp $ +// $Id: Window.cc,v 1.172 2003/05/11 23:44:08 rathnor Exp $ #include "Window.hh" @@ -1249,8 +1249,10 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { if (iconic || reassoc) { screen().reassociateWindow(this, screen().getCurrentWorkspace()->workspaceID(), false); - } else if (moving || m_workspace_number != screen().getCurrentWorkspace()->workspaceID()) + } else if (moving || m_workspace_number != screen().getCurrentWorkspace()->workspaceID()) { + oplock = false; return; + } bool was_iconic = iconic; @@ -1264,7 +1266,7 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { (*client_it)->show(); (*client_it)->setEventMask(PropertyChangeMask | StructureNotifyMask | FocusChangeMask); } - + m_frame.show(); if (was_iconic && screen().doFocusNew()) @@ -2622,7 +2624,6 @@ void FluxboxWindow::applyDecorations() { else m_frame.hideHandle(); - m_frame.show(); // is reconfigure needed here? } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 2793670..b77bd73 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.138 2003/05/11 22:19:17 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.139 2003/05/11 23:44:09 rathnor Exp $ #include "fluxbox.hh" @@ -2382,9 +2382,9 @@ void Fluxbox::revertFocus(BScreen &screen) { // Fluxbox::FocusModel = sloppy, click, whatever WinClient *next_focus = screen.getLastFocusedWindow(screen.getCurrentWorkspaceID()); - if (next_focus && next_focus->fbwindow()) { - setFocusedWindow(next_focus->fbwindow()); - } else { + // if setting focus fails, or isn't possible, fallback correctly + if (!(next_focus && next_focus->fbwindow() && + next_focus->fbwindow()->setCurrentClient(*next_focus, true))) { setFocusedWindow(0); // so we don't get dangling m_focused_window pointer switch (screen.getFocusModel()) { case SLOPPYFOCUS: -- cgit v0.11.2