diff options
author | Adam Endrodi <ext-adam.endrodi@nokia.com> | 2011-01-20 16:29:46 +0200 |
---|---|---|
committer | Adam Endrodi <ext-adam.endrodi@nokia.com> | 2011-01-21 18:32:43 +0200 |
commit | f7ecd5a5bdb687b609b4b1e37b5ad0847ae8aa35 (patch) | |
tree | 5f18d4e16284fddd3b2a71b3febc25f83eede298 | |
parent | abf820ce49c4484c49408b3a448f65304b07ecb4 (diff) |
don't let mdecorator managing clients falsely
...because that prevents humhumhumhum the application making the UI appear
to be frozen. The test cases are:
1. boot, open wg, clock
2. stop and restart mc
3. try to go back to the desktop
4. it takes a very long time for us to get hold on all the windows.
therefore you can't go back to desktop, and by the time we finally
get control back the ping timer of clock has expired and we think
it's hung
5. we quickly process the accumulated events of 3) and clock is sent
to the background, setting its state to Normal
6. now we have a Normal state undecorated window managed by md
7. when you bring clock forth again, as though compareWindows() will
sort md above clock as it's supposed to do, checkStacking() lowers
it again because clock is not Hung
8. and that's it
another scenario:
1. start an app
2. kill -STOP
3. bring desktop forth via a CLIENT_MESSAGE
4. see 5. above
and yet another one:
1. start an app
2. kill -STOP
3. restart mc
4. see 4. above
* src/mcompositemanager.cpp (MCompositeManagerPrivate::checkStacking):
Clear the managed client of the decorator if we find that there's
no-one to manage.
* src/mdecoratorframe.cpp (MDecoratorFrame::setDecoratorItem):
Reset the managed client of the newly discovered decorator.
-rw-r--r-- | src/mcompositemanager.cpp | 1 | ||||
-rw-r--r-- | src/mdecoratorframe.cpp | 29 | ||||
-rw-r--r-- | src/mdecoratorframe.h | 1 |
3 files changed, 18 insertions, 13 deletions
diff --git a/src/mcompositemanager.cpp b/src/mcompositemanager.cpp index e277c3a..81f391b 100644 --- a/src/mcompositemanager.cpp +++ b/src/mcompositemanager.cpp @@ -2088,6 +2088,7 @@ void MCompositeManagerPrivate::checkStacking(bool force_visibility_check, if (deco_i > 0) { STACKING_MOVE(deco_i, 0); stacking_list.move(deco_i, 0); + MDecoratorFrame::instance()->setManagedWindow(0); } } diff --git a/src/mdecoratorframe.cpp b/src/mdecoratorframe.cpp index 3ae6e80..dddd579 100644 --- a/src/mdecoratorframe.cpp +++ b/src/mdecoratorframe.cpp @@ -84,9 +84,21 @@ void MDecoratorFrame::updateManagedWindowGeometry() if (client && client->needDecoration()) setDecoratorAvailableRect(available_rect); } + +void MDecoratorFrame::sendManagedWindowId() +{ + qulonglong winid = client ? client->window() : 0; + if(client) + remote_decorator->invoke("MAbstractDecorator", + "RemoteSetClientGeometry", + client->propertyCache()->requestedGeometry()); + remote_decorator->invoke("MAbstractDecorator", + "RemoteSetAutoRotation", false); + remote_decorator->invoke("MAbstractDecorator", + "RemoteSetManagedWinId", winid); +} -void MDecoratorFrame::setManagedWindow(MCompositeWindow *cw, - bool no_resize) +void MDecoratorFrame::setManagedWindow(MCompositeWindow *cw, bool no_resize) { this->no_resize = no_resize; @@ -96,19 +108,9 @@ void MDecoratorFrame::setManagedWindow(MCompositeWindow *cw, disconnect(client, SIGNAL(destroyed()), this, SLOT(destroyClient())); client = cw; - qulonglong winid = client ? client->window() : 0; if (!decorator_item) return; - - if(cw) - remote_decorator->invoke("MAbstractDecorator", - "RemoteSetClientGeometry", - cw->propertyCache()->requestedGeometry()); - remote_decorator->invoke("MAbstractDecorator", - "RemoteSetAutoRotation", false); - remote_decorator->invoke("MAbstractDecorator", - "RemoteSetManagedWinId", winid); - + sendManagedWindowId(); if (cw) connect(cw, SIGNAL(destroyed()), SLOT(destroyClient())); } @@ -127,6 +129,7 @@ void MDecoratorFrame::setDecoratorItem(MCompositeWindow *window) MTexturePixmapItem *item = (MTexturePixmapItem *) window; if (!decorator_window) setDecoratorWindow(item->window()); + sendManagedWindowId(); } MCompositeWindow *MDecoratorFrame::decoratorItem() const diff --git a/src/mdecoratorframe.h b/src/mdecoratorframe.h index 1fc87f2..82b0f30 100644 --- a/src/mdecoratorframe.h +++ b/src/mdecoratorframe.h @@ -109,6 +109,7 @@ private slots: private: explicit MDecoratorFrame(QObject *object = 0); + void sendManagedWindowId(); static MDecoratorFrame *d; MCompositeWindow *client; |