aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2006-07-20 03:25:28 (GMT)
committermarkt <markt>2006-07-20 03:25:28 (GMT)
commitf4d1af12083863f1aa63c88e3eb55a9317758fc1 (patch)
tree77bc2a47dd8f7d2df24afeae506452ab535746ae
parenta736f12ac58ec8e60b01ee38dc244b6850d87e21 (diff)
downloadfluxbox_paul-f4d1af12083863f1aa63c88e3eb55a9317758fc1.zip
fluxbox_paul-f4d1af12083863f1aa63c88e3eb55a9317758fc1.tar.bz2
keep tabs in same order on restart (except some extremely unlikely cases)
-rw-r--r--src/Screen.cc26
-rw-r--r--src/Screen.hh4
-rw-r--r--src/WinClient.cc2
-rw-r--r--src/Window.cc4
4 files changed, 20 insertions, 16 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 73af5e9..a8f02c2 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1343,7 +1343,8 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1343 1343
1344 // check if it should be grouped with something else 1344 // check if it should be grouped with something else
1345 FluxboxWindow *win; 1345 FluxboxWindow *win;
1346 if ((win = findGroupLeft(*winclient)) != 0) { 1346 WinClient *other;
1347 if ((other = findGroupLeft(*winclient)) && (win = other->fbwindow())) {
1347 win->attachClient(*winclient); 1348 win->attachClient(*winclient);
1348 Fluxbox::instance()->attachSignals(*winclient); 1349 Fluxbox::instance()->attachSignals(*winclient);
1349 } else { 1350 } else {
@@ -1369,11 +1370,10 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1369 1370
1370 // we also need to check if another window expects this window to the left 1371 // we also need to check if another window expects this window to the left
1371 // and if so, then join it. 1372 // and if so, then join it.
1372 FluxboxWindow *otherwin = 0; 1373 if ((other = findGroupRight(*winclient)) && other->fbwindow() != win)
1373 // TODO: does this do the right stuff focus-wise? 1374 win->attachClient(*other);
1374 if ((otherwin = findGroupRight(*winclient)) && otherwin != win) { 1375 else if (other)
1375 win->attachClient(otherwin->winClient()); 1376 win->moveClientRightOf(*other, *winclient);
1376 }
1377 1377
1378 m_clientlist_sig.notify(); 1378 m_clientlist_sig.notify();
1379 1379
@@ -2034,10 +2034,10 @@ void BScreen::updateSize() {
2034 2034
2035 2035
2036/** 2036/**
2037 * Find the group of windows to this window's left 2037 * Find the winclient to this window's left
2038 * So, we check the leftgroup hint, and see if we know any windows 2038 * So, we check the leftgroup hint, and see if we know any windows
2039 */ 2039 */
2040FluxboxWindow *BScreen::findGroupLeft(WinClient &winclient) { 2040WinClient *BScreen::findGroupLeft(WinClient &winclient) {
2041 Window w = winclient.getGroupLeftWindow(); 2041 Window w = winclient.getGroupLeftWindow();
2042 if (w == None) 2042 if (w == None)
2043 return 0; 2043 return 0;
@@ -2051,13 +2051,10 @@ FluxboxWindow *BScreen::findGroupLeft(WinClient &winclient) {
2051 // something is not consistent 2051 // something is not consistent
2052 return 0; 2052 return 0;
2053 2053
2054 if (have_client) 2054 return have_client;
2055 return have_client->fbwindow();
2056 else
2057 return 0;
2058} 2055}
2059 2056
2060FluxboxWindow *BScreen::findGroupRight(WinClient &winclient) { 2057WinClient *BScreen::findGroupRight(WinClient &winclient) {
2061 Groupables::iterator it = m_expecting_groups.find(winclient.window()); 2058 Groupables::iterator it = m_expecting_groups.find(winclient.window());
2062 if (it == m_expecting_groups.end()) 2059 if (it == m_expecting_groups.end())
2063 return 0; 2060 return 0;
@@ -2073,8 +2070,9 @@ FluxboxWindow *BScreen::findGroupRight(WinClient &winclient) {
2073 other->getGroupLeftWindow() != None) 2070 other->getGroupLeftWindow() != None)
2074 return 0; 2071 return 0;
2075 2072
2076 return other->fbwindow(); 2073 return other;
2077} 2074}
2075
2078void BScreen::initXinerama() { 2076void BScreen::initXinerama() {
2079#ifdef XINERAMA 2077#ifdef XINERAMA
2080 Display *display = FbTk::App::instance()->display(); 2078 Display *display = FbTk::App::instance()->display();
diff --git a/src/Screen.hh b/src/Screen.hh
index 0a96df2..0a1eaf8 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -327,8 +327,8 @@ public:
327 // grouping - we want ordering, so we can either search for a 327 // grouping - we want ordering, so we can either search for a
328 // group to the left, or to the right (they'll be different if 328 // group to the left, or to the right (they'll be different if
329 // they exist). 329 // they exist).
330 FluxboxWindow *findGroupLeft(WinClient &winclient); 330 WinClient *findGroupLeft(WinClient &winclient);
331 FluxboxWindow *findGroupRight(WinClient &winclient); 331 WinClient *findGroupRight(WinClient &winclient);
332 332
333 // notify netizens 333 // notify netizens
334 void updateNetizenCurrentWorkspace(); 334 void updateNetizenCurrentWorkspace();
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 1ede4d8..4e508fb 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -623,6 +623,8 @@ Window WinClient::getGroupLeftWindow() const {
623 623
624 624
625void WinClient::setGroupLeftWindow(Window win) { 625void WinClient::setGroupLeftWindow(Window win) {
626 if (m_screen.isShuttingdown())
627 return;
626 Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); 628 Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False);
627 changeProperty(group_left_hint, XA_WINDOW, 32, 629 changeProperty(group_left_hint, XA_WINDOW, 32,
628 PropModeReplace, (unsigned char *) &win, 1); 630 PropModeReplace, (unsigned char *) &win, 1);
diff --git a/src/Window.cc b/src/Window.cc
index f9581ed..2bb19a2 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -628,6 +628,7 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
628 WinClient *was_focused = 0; 628 WinClient *was_focused = 0;
629 WinClient *focused_win = FocusControl::focusedWindow(); 629 WinClient *focused_win = FocusControl::focusedWindow();
630 630
631 WinClient *other = m_screen.findGroupLeft(client);
631 // get the current window on the end of our client list 632 // get the current window on the end of our client list
632 Window leftwin = None; 633 Window leftwin = None;
633 if (!clientList().empty()) 634 if (!clientList().empty())
@@ -691,6 +692,9 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
691 692
692 client.saveBlackboxAttribs(m_blackbox_attrib); 693 client.saveBlackboxAttribs(m_blackbox_attrib);
693 m_clientlist.push_back(&client); 694 m_clientlist.push_back(&client);
695
696 if (other && other->fbwindow() == this)
697 moveClientRightOf(client, *other);
694 } 698 }
695 699
696 // make sure that the state etc etc is updated for the new client 700 // make sure that the state etc etc is updated for the new client