fix up various focus-related issues
rathnor rathnor
3 files changed,
14 insertions(+),
10 deletions(-)
M
src/Screen.cc
→
src/Screen.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@ return 0;
} 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);
M
src/Window.cc
→
src/Window.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@ oplock = true;
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 @@ (*client_it)->setEventMask(NoEventMask);
(*client_it)->show(); (*client_it)->setEventMask(PropertyChangeMask | StructureNotifyMask | FocusChangeMask); } - + m_frame.show(); if (was_iconic && screen().doFocusNew())@@ -2622,7 +2624,6 @@ m_frame.showHandle();
else m_frame.hideHandle(); - m_frame.show(); // is reconfigure needed here? }
M
src/fluxbox.cc
→
src/fluxbox.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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 @@ // resource.focus_last = whether we focus last focused when changing workspace
// 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: