aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
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 /src/Screen.cc
parenta736f12ac58ec8e60b01ee38dc244b6850d87e21 (diff)
downloadfluxbox-f4d1af12083863f1aa63c88e3eb55a9317758fc1.zip
fluxbox-f4d1af12083863f1aa63c88e3eb55a9317758fc1.tar.bz2
keep tabs in same order on restart (except some extremely unlikely cases)
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc26
1 files changed, 12 insertions, 14 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();