all repos — fluxbox @ 63ac5deee691f7b528399c0f03e100e983a8cb55

custom fork of the fluxbox windowmanager

fix nextFocus problem with tabbed windows
rathnor rathnor
commit

63ac5deee691f7b528399c0f03e100e983a8cb55

parent

ecf483e0c64d4123e16298464260af5ab6ed3c55

4 files changed, 53 insertions(+), 35 deletions(-)

jump to
M src/Screen.ccsrc/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.138 2003/04/26 18:27:01 fluxgen Exp $ +// $Id: Screen.cc,v 1.139 2003/04/27 14:36:03 rathnor Exp $ #include "Screen.hh"

@@ -500,6 +500,7 @@ m_workspacenames_sig(*this), // workspace names signal

m_currentworkspace_sig(*this), // current workspace signal m_layermanager(num_layers), cycling_focus(false), + cycling_last(0), m_windowtheme(new FbWinFrameTheme(scrn)), m_menutheme(new FbTk::MenuTheme(scrn)), resource(rm, screenname, altscreenname),

@@ -1474,6 +1475,7 @@ if (!(opts & CYCLELINEAR)) {

if (!cycling_focus) { cycling_focus = True; cycling_window = focused_list.begin(); + cycling_last = 0; } else { // already cycling, so restack to put windows back in their proper order m_layermanager.restack();

@@ -1498,7 +1500,18 @@ if (fbwin && !fbwin->isIconic() &&

(fbwin->isStuck() || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) { // either on this workspace, or stuck - if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) { + + // keep track of the originally selected window in a set + WinClient &last_client = fbwin->winClient(); + + if (! (doSkipWindow(fbwin, opts) || !fbwin->setCurrentClient(**it)) ) { + // moved onto a new fbwin + if (!cycling_last || cycling_last->fbwindow() != fbwin) { + if (cycling_last) + // set back to orig current Client in that fbwin + cycling_last->fbwindow()->setCurrentClient(*cycling_last, false); + cycling_last = &last_client; + } fbwin->tempRaise(); break; }

@@ -1552,6 +1565,7 @@ if (!(opts & CYCLELINEAR)) {

if (!cycling_focus) { cycling_focus = True; cycling_window = focused_list.end(); + cycling_last = 0; } else { // already cycling, so restack to put windows back in their proper order m_layermanager.restack();

@@ -1577,7 +1591,19 @@ if (fbwin && !fbwin->isIconic() &&

(fbwin->isStuck() || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) { // either on this workspace, or stuck - if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) { + + // keep track of the originally selected window in a set + WinClient &last_client = fbwin->winClient(); + + + if (! (doSkipWindow(fbwin, opts) || !fbwin->setCurrentClient(**it)) ) { + // moved onto a new fbwin + if (!cycling_last || cycling_last->fbwindow() != fbwin) { + if (cycling_last) + // set back to orig current Client in that fbwin + cycling_last->fbwindow()->setCurrentClient(*cycling_last, false); + cycling_last = &last_client; + } fbwin->tempRaise(); break; }

@@ -2389,6 +2415,7 @@ */

void BScreen::notifyReleasedKeys(XKeyEvent &ke) { if (cycling_focus) { cycling_focus = false; + cycling_last = 0; // put currently focused window to top WinClient *client = *cycling_window; focused_list.erase(cycling_window);
M src/Screen.hhsrc/Screen.hh

@@ -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.hh,v 1.87 2003/04/26 14:47:40 fluxgen Exp $ +// $Id: Screen.hh,v 1.88 2003/04/27 14:36:04 rathnor Exp $ #ifndef SCREEN_HH #define SCREEN_HH

@@ -357,6 +357,7 @@ // This list keeps the order of window focusing for this screen

// Screen global so it works for sticky windows too. FocusedWindows focused_list; FocusedWindows::iterator cycling_window; + WinClient *cycling_last; std::auto_ptr<Slit> m_slit;
M src/Window.ccsrc/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.152 2003/04/27 12:31:43 fluxgen Exp $ +// $Id: Window.cc,v 1.153 2003/04/27 14:36:04 rathnor Exp $ #include "Window.hh"

@@ -702,16 +702,15 @@ m_frame.setLabelButtonFocus(*m_labelbuttons[m_client]);

setInputFocus(); } -void FluxboxWindow::setCurrentClient(WinClient &client) { +bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { // make sure it's in our list if (client.m_win != this) - return; + return false; m_client = &client; m_client->raise(); - Fluxbox::instance()->setFocusedWindow(this); m_frame.setLabelButtonFocus(*m_labelbuttons[m_client]); - setInputFocus(); + return setinput && setInputFocus(); } bool FluxboxWindow::isGroupable() const {

@@ -2321,21 +2320,15 @@ // dx = current left side, dy = current top

doSnapping(dx, dy); if (! screen.doOpaqueMove()) { - XDrawRectangle(display, screen.getRootWindow(), - screen.rootTheme().opGC(), + XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(), last_move_x, last_move_y, - m_frame.width() + - 2*frame().window().borderWidth() - 1, - m_frame.height() + - 2*frame().window().borderWidth() - 1); + m_frame.width() + 2*frame().window().borderWidth()-1, + m_frame.height() + 2*frame().window().borderWidth()-1); - XDrawRectangle(display, screen.getRootWindow(), - screen.rootTheme().opGC(), + XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(), dx, dy, - m_frame.width() + - 2*frame().window().borderWidth()-1, - m_frame.height() + - 2*frame().window().borderWidth()-1); + m_frame.width() + 2*frame().window().borderWidth()-1, + m_frame.height() + 2*frame().window().borderWidth()-1); last_move_x = dx; last_move_y = dy; } else {

@@ -2356,8 +2349,7 @@ if (! resizing) {

startResizing(me.window, me.x, me.y, left); } else if (resizing) { // draw over old rect - XDrawRectangle(display, screen.getRootWindow(), - screen.rootTheme().opGC(), + XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(), last_resize_x, last_resize_y, last_resize_w - 1 + 2 * m_frame.window().borderWidth(), last_resize_h - 1 + 2 * m_frame.window().borderWidth());

@@ -2385,8 +2377,7 @@ right_fixsize(&gx, &gy);

} // draw resize rectangle - XDrawRectangle(display, screen.getRootWindow(), - screen.rootTheme().opGC(), + XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(), last_resize_x, last_resize_y, last_resize_w - 1 + 2 * m_frame.window().borderWidth(), last_resize_h - 1 + 2 * m_frame.window().borderWidth());

@@ -2477,6 +2468,7 @@ if (ev.window == frame().window() ||

ev.window == m_client->window()) { if ((screen.isSloppyFocus() || screen.isSemiSloppyFocus()) && !isFocused()) { + // check that there aren't any subsequent leave notify events in the // X event queue

@@ -2488,6 +2480,7 @@ XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa);

if ((!sa.leave || sa.inferior) && setInputFocus()) installColormap(True); + } }

@@ -2653,18 +2646,15 @@ fluxbox->maskWindowEvents(0, 0);

if (! screen.doOpaqueMove()) { - XDrawRectangle(FbTk::App::instance()->display(), - screen.getRootWindow(), screen.rootTheme().opGC(), + XDrawRectangle(FbTk::App::instance()->display(), screen.getRootWindow(), screen.rootTheme().opGC(), last_move_x, last_move_y, - frame().width() + 2*frame().window().borderWidth() - 1, - frame().height() + 2*frame().window().borderWidth() - 1); - + frame().width() + 2*frame().window().borderWidth()-1, + frame().height() + 2*frame().window().borderWidth()-1); moveResize(last_move_x, last_move_y, m_frame.width(), m_frame.height()); - if (workspace_number != getScreen().getCurrentWorkspaceID()) { - deiconify(true, false); + screen.reassociateWindow(this, getScreen().getCurrentWorkspaceID(), true); + m_frame.show(); } - fluxbox->ungrab(); } else moveResize(m_frame.x(), m_frame.y(), m_frame.width(), m_frame.height());
M src/Window.hhsrc/Window.hh

@@ -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.hh,v 1.63 2003/04/26 14:05:47 rathnor Exp $ +// $Id: Window.hh,v 1.64 2003/04/27 14:36:05 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -124,7 +124,7 @@ void detachCurrentClient();

/// remove client from client list bool removeClient(WinClient &client); /// set new current client and raise it - void setCurrentClient(WinClient &client); + bool setCurrentClient(WinClient &client, bool setinput = true); WinClient *findClient(Window win); void nextClient(); void prevClient();