all repos — fluxbox @ f4d1af12083863f1aa63c88e3eb55a9317758fc1

custom fork of the fluxbox windowmanager

keep tabs in same order on restart (except some extremely unlikely cases)
markt markt
commit

f4d1af12083863f1aa63c88e3eb55a9317758fc1

parent

a736f12ac58ec8e60b01ee38dc244b6850d87e21

4 files changed, 20 insertions(+), 16 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -1343,7 +1343,8 @@ }

// check if it should be grouped with something else FluxboxWindow *win; - if ((win = findGroupLeft(*winclient)) != 0) { + WinClient *other; + if ((other = findGroupLeft(*winclient)) && (win = other->fbwindow())) { win->attachClient(*winclient); Fluxbox::instance()->attachSignals(*winclient); } else {

@@ -1369,11 +1370,10 @@ focusControl().addFocusBack(*winclient);

// we also need to check if another window expects this window to the left // and if so, then join it. - FluxboxWindow *otherwin = 0; - // TODO: does this do the right stuff focus-wise? - if ((otherwin = findGroupRight(*winclient)) && otherwin != win) { - win->attachClient(otherwin->winClient()); - } + if ((other = findGroupRight(*winclient)) && other->fbwindow() != win) + win->attachClient(*other); + else if (other) + win->moveClientRightOf(*other, *winclient); m_clientlist_sig.notify();

@@ -2034,10 +2034,10 @@ }

/** - * Find the group of windows to this window's left + * Find the winclient to this window's left * So, we check the leftgroup hint, and see if we know any windows */ -FluxboxWindow *BScreen::findGroupLeft(WinClient &winclient) { +WinClient *BScreen::findGroupLeft(WinClient &winclient) { Window w = winclient.getGroupLeftWindow(); if (w == None) return 0;

@@ -2051,13 +2051,10 @@ } else if (&have_client->screen() != &winclient.screen())

// something is not consistent return 0; - if (have_client) - return have_client->fbwindow(); - else - return 0; + return have_client; } -FluxboxWindow *BScreen::findGroupRight(WinClient &winclient) { +WinClient *BScreen::findGroupRight(WinClient &winclient) { Groupables::iterator it = m_expecting_groups.find(winclient.window()); if (it == m_expecting_groups.end()) return 0;

@@ -2073,8 +2070,9 @@ if (!winclient.hasGroupLeftWindow() ||

other->getGroupLeftWindow() != None) return 0; - return other->fbwindow(); + return other; } + void BScreen::initXinerama() { #ifdef XINERAMA Display *display = FbTk::App::instance()->display();
M src/Screen.hhsrc/Screen.hh

@@ -327,8 +327,8 @@

// grouping - we want ordering, so we can either search for a // group to the left, or to the right (they'll be different if // they exist). - FluxboxWindow *findGroupLeft(WinClient &winclient); - FluxboxWindow *findGroupRight(WinClient &winclient); + WinClient *findGroupLeft(WinClient &winclient); + WinClient *findGroupRight(WinClient &winclient); // notify netizens void updateNetizenCurrentWorkspace();
M src/WinClient.ccsrc/WinClient.cc

@@ -623,6 +623,8 @@ }

void WinClient::setGroupLeftWindow(Window win) { + if (m_screen.isShuttingdown()) + return; Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); changeProperty(group_left_hint, XA_WINDOW, 32, PropModeReplace, (unsigned char *) &win, 1);
M src/Window.ccsrc/Window.cc

@@ -628,6 +628,7 @@ frame().setClientWindow(client);

WinClient *was_focused = 0; WinClient *focused_win = FocusControl::focusedWindow(); + WinClient *other = m_screen.findGroupLeft(client); // get the current window on the end of our client list Window leftwin = None; if (!clientList().empty())

@@ -691,6 +692,9 @@ was_focused = focused_win;

client.saveBlackboxAttribs(m_blackbox_attrib); m_clientlist.push_back(&client); + + if (other && other->fbwindow() == this) + moveClientRightOf(client, *other); } // make sure that the state etc etc is updated for the new client