summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-11-05 15:26:59 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-11-05 15:26:59 +0800
commit46c927b2daaf636e327e6d766ca167bbae275ee7 (patch)
treeb0bfde83d7f89969720967419cd1ffe4332c71a8
parentc204ec35413113cae0e1026446ead636b09df05a (diff)
downloadgroup-46c927b2daaf636e327e6d766ca167bbae275ee7.tar.gz
group-46c927b2daaf636e327e6d766ca167bbae275ee7.tar.bz2
Don't restore tabbed state if the top id is no longer in the group
-rw-r--r--src/init.cpp9
-rw-r--r--src/tab.cpp6
2 files changed, 11 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 4d963dc..e20df39 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -295,6 +295,7 @@ GroupScreen::postLoad ()
{
foreach (GroupSelection *group, mGroups)
{
+ bool topIdInGroup = false;
for (std::list <Window>::iterator it = group->mWindowIds.begin ();
it != group->mWindowIds.end ();
it++)
@@ -302,7 +303,11 @@ GroupScreen::postLoad ()
CompWindow *w = screen->findWindow (*it);
if (w)
+ {
+ if (group->mTopId == (*it))
+ topIdInGroup = true;
GroupWindow::get (w)->addWindowToGroup (group);
+ }
else
{
group->mWindowIds.erase (it);
@@ -310,7 +315,7 @@ GroupScreen::postLoad ()
}
}
- if (group->mTopId)
+ if (group->mTopId && topIdInGroup)
{
CompWindow *w;
@@ -340,6 +345,8 @@ GroupScreen::postLoad ()
group->mTabBar->mSelectionLayer->render ();
}
}
+ else
+ group->mTopId = None;
}
}
diff --git a/src/tab.cpp b/src/tab.cpp
index 51fcd4a..e46af21 100644
--- a/src/tab.cpp
+++ b/src/tab.cpp
@@ -2982,11 +2982,11 @@ GroupTabBar::GroupTabBar (GroupSelection *group,
foreach (CompWindow *cw, mGroup->mWindows)
createSlot (cw);
- mGroup->mTabBar->createInputPreventionWindow ();
- mGroup->mTabBar->mTopTab = GroupWindow::get (topTab)->mSlot;
+ createInputPreventionWindow ();
+ mTopTab = GroupWindow::get (topTab)->mSlot;
group->mTopId = topTab->id ();
- mGroup->mTabBar->recalcTabBarPos (WIN_CENTER_X (topTab),
+ recalcTabBarPos (WIN_CENTER_X (topTab),
WIN_X (topTab), WIN_X (topTab) + WIN_WIDTH (topTab));
}