From 295c929f984a5dbc54d9672e092e79abcf0f227a Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 2 Jul 2007 05:27:21 +0000 Subject: minor usability fix for :Tab and :GoToWindow commands fixed handle rendering when switching from a style without them --- src/CurrentWindowCmd.cc | 7 ++++--- src/FbWinFrame.cc | 5 +++-- src/FocusControl.cc | 14 ++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index f411f83..4a60e63 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc @@ -94,9 +94,10 @@ void TakeToPrevWorkspaceCmd::real_execute() { } void GoToTabCmd::real_execute() { - int num = m_tab_num + (m_tab_num > 0 ? 0 : fbwindow().numClients() + 1); - if (num < 1 || num > fbwindow().numClients()) - return; + int num = m_tab_num; + if (num < 0) num += fbwindow().numClients() + 1; + if (num < 1) num = 1; + if (num > fbwindow().numClients()) num = fbwindow().numClients(); FluxboxWindow::ClientList::iterator it = fbwindow().clientList().begin(); diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index a387744..6f9c86e 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -789,10 +789,11 @@ bool FbWinFrame::showHandle() { if (m_use_handle || theme().handleWidth() == 0) return false; + m_use_handle = true; + // weren't previously rendered... renderHandles(); - - m_use_handle = true; + applyHandles(); m_handle.show(); m_handle.showSubwindows(); // shows grips diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 8706752..47a0a71 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -169,16 +169,15 @@ void FocusControl::cycleFocus(Focusables &window_list, const ClientPattern *pat, void FocusControl::goToWindowNumber(Focusables &winlist, int num, const ClientPattern *pat) { + Focusable *last_matched = 0; if (num > 0) { Focusables::iterator it = winlist.begin(); Focusables::iterator it_end = winlist.end(); for (; it != it_end; ++it) { if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) { --num; - if (!num) { - (*it)->focus(); - return; - } + last_matched = *it; + if (!num) break; } } } else if (num < 0) { @@ -187,13 +186,12 @@ void FocusControl::goToWindowNumber(Focusables &winlist, int num, for (; it != it_end; ++it) { if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) { ++num; - if (!num) { - (*it)->focus(); - return; - } + last_matched = *it; + if (!num) break; } } } + if (last_matched) last_matched->focus(); } void FocusControl::addFocusBack(WinClient &client) { -- cgit v0.11.2