fix desktopgrid window manage on VD amount change

BUG: 289747
FIXED-IN: 4.9.2
REVIEW: 106391
This commit is contained in:
Thomas Lübking 2012-09-09 14:24:06 +02:00
parent 2b0c73bea2
commit 7775510918
2 changed files with 15 additions and 9 deletions

View file

@ -383,7 +383,7 @@ void DesktopGridEffect::slotWindowAdded(EffectWindow* w)
if (!activated)
return;
if (isUsingPresentWindows()) {
if (w->isDesktop() || w->isDock() || !w->isCurrentTab())
if (!isRelevantWithPresentWindows(w))
return; // don't add
if (w->isOnAllDesktops()) {
for (int i = 0; i < effects->numberOfDesktops(); i++) {
@ -1105,8 +1105,7 @@ void DesktopGridEffect::setup()
for (int j = 0; j < effects->numScreens(); j++) {
WindowMotionManager manager;
foreach (EffectWindow * w, effects->stackingOrder()) {
if (w->isOnDesktop(i) && w->screen() == j && !w->isDesktop() && !w->isDock() &&
w->isCurrentTab() && !w->isSkipSwitcher() && w->isOnCurrentActivity()) {
if (w->isOnDesktop(i) && w->screen() == j &&isRelevantWithPresentWindows(w)) {
manager.manage(w);
}
}
@ -1317,12 +1316,11 @@ void DesktopGridEffect::desktopsAdded(int old)
}
if (isUsingPresentWindows()) {
for (int i = old; i <= effects->numberOfDesktops(); i++) {
for (int j = 0; j < effects->numScreens(); j++) {
for (int i = old+1; i <= effects->numberOfDesktops(); ++i) {
for (int j = 0; j < effects->numScreens(); ++j) {
WindowMotionManager manager;
foreach (EffectWindow * w, effects->stackingOrder()) {
if (w->isOnDesktop(i) && w->screen() == j && !w->isDesktop() && !w->isDock() &&
w->isCurrentTab()) {
if (w->isOnDesktop(i) && w->screen() == j &&isRelevantWithPresentWindows(w)) {
manager.manage(w);
}
}
@ -1360,8 +1358,9 @@ void DesktopGridEffect::desktopsRemoved(int old)
for (int j = 0; j < effects->numScreens(); ++j) {
WindowMotionManager& manager = m_managers[(desktop-1)*(effects->numScreens())+j ];
foreach (EffectWindow * w, effects->stackingOrder()) {
if (!manager.isManaging(w) && w->isOnDesktop(desktop) && w->screen() == j &&
!w->isDesktop() && !w->isDock() && w->isCurrentTab()) {
if (manager.isManaging(w))
continue;
if (w->isOnDesktop(desktop) && w->screen() == j && isRelevantWithPresentWindows(w)) {
manager.manage(w);
}
}
@ -1380,6 +1379,12 @@ bool DesktopGridEffect::isActive() const
return timeline.currentValue() != 0 || activated || (isUsingPresentWindows() && isMotionManagerMovingWindows());
}
bool DesktopGridEffect::isRelevantWithPresentWindows(EffectWindow *w) const
{
return !(w->isDesktop() || w->isDock() || w->isSkipSwitcher()) &&
w->isCurrentTab() && w->isOnCurrentActivity();
}
/************************************************
* DesktopButtonView
************************************************/

View file

@ -134,6 +134,7 @@ private:
void setupGrid();
void finish();
bool isMotionManagerMovingWindows() const;
bool isRelevantWithPresentWindows(EffectWindow *w) const;
bool isUsingPresentWindows() const;
QRectF moveGeometryToDesktop(int desktop) const;
void desktopsAdded(int old);