summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimmo Hämäläinen <kimmo.hamalainen@nokia.com>2010-12-09 18:27:12 +0200
committerAdam Endrodi <ext-adam.endrodi@nokia.com>2010-12-14 15:44:34 +0200
commitd913618945a385ead8b92ee187934414bb5377c3 (patch)
tree4d43cc6ce64cf11c7dc4cc739e7935a34751e060
parentf16eb62bff723990e5b3e94f8d2f1e1bda89f1aa (diff)
Fixes: NB#210587 - App view jumps to fullscreen suddenly when minimizing after HWKB toolbar was invoked
- MCompositeManagerPrivate::exposeSwitcher(): call clientMessageEvent() directly, also optimise a bit to do the call only for one window, clientMessageEvent() is supposed to handle the rest - MCompositeScene::drawItems(): no need to paint grouped windows twice... - MCompositeWindowGroup::~MCompositeWindowGroup(): stack windows when the stack is dirty to avoid wrong kind of redraw
-rw-r--r--src/mcompositemanager.cpp48
-rw-r--r--src/mcompositemanager.h1
-rw-r--r--src/mcompositescene.cpp5
-rw-r--r--src/mcompositewindowgroup.cpp9
4 files changed, 36 insertions, 27 deletions
diff --git a/src/mcompositemanager.cpp b/src/mcompositemanager.cpp
index a065ad7..28c3f40 100644
--- a/src/mcompositemanager.cpp
+++ b/src/mcompositemanager.cpp
@@ -3509,33 +3509,33 @@ void MCompositeManagerPrivate::gotHungWindow(MCompositeWindow *w)
void MCompositeManagerPrivate::exposeSwitcher()
{
- Display* dpy = QX11Info::display();
-
- for (QHash<Window, MCompositeWindow *>::iterator it = windows.begin();
- it != windows.end(); ++it) {
- MCompositeWindow *i = it.value();
- if (!i->isAppWindow(true) ||
- i->propertyCache()->windowState() == IconicState ||
+ MCompositeWindow *i = 0;
+ for (int j = stacking_list.size() - 1; j >= 0; --j) {
+ Window w = stacking_list.at(j);
+ if (!(i = COMPOSITE_WINDOW(w)) || !i->propertyCache() ||
+ !i->propertyCache()->isMapped() ||
+ i->propertyCache()->windowTypeAtom() == ATOM(_NET_WM_WINDOW_TYPE_DESKTOP)
+ || i->propertyCache()->windowState() == IconicState ||
// skip devicelock and screenlock windows
- i->propertyCache()->dontIconify() ||
-
- i->propertyCache()->windowTypeAtom() == ATOM(_NET_WM_WINDOW_TYPE_DESKTOP))
+ i->propertyCache()->dontIconify() || !i->isAppWindow(true))
continue;
-
- XEvent e;
- e.xclient.type = ClientMessage;
- e.xclient.message_type = ATOM(WM_CHANGE_STATE);
- e.xclient.display = dpy;
- e.xclient.window = i->window();
- e.xclient.format = 32;
- e.xclient.data.l[0] = IconicState;
- e.xclient.data.l[1] = 0;
- e.xclient.data.l[2] = 0;
- e.xclient.data.l[3] = 0;
- e.xclient.data.l[4] = 0;
- XSendEvent(dpy, RootWindow(dpy, 0),
- False, (SubstructureNotifyMask|SubstructureRedirectMask), &e);
+ break;
}
+ if (!i) return;
+
+ XEvent e;
+ e.xclient.type = ClientMessage;
+ e.xclient.message_type = ATOM(WM_CHANGE_STATE);
+ e.xclient.display = QX11Info::display();
+ e.xclient.window = i->window();
+ e.xclient.format = 32;
+ e.xclient.data.l[0] = IconicState;
+ e.xclient.data.l[1] = 0;
+ e.xclient.data.l[2] = 0;
+ e.xclient.data.l[3] = 0;
+ e.xclient.data.l[4] = 0;
+ // no need to send to X server first, also avoids NB#210587
+ clientMessageEvent(&(e.xclient));
}
void MCompositeManagerPrivate::installX11EventFilter(long xevent,
diff --git a/src/mcompositemanager.h b/src/mcompositemanager.h
index 07b2082..765bce7 100644
--- a/src/mcompositemanager.h
+++ b/src/mcompositemanager.h
@@ -194,6 +194,7 @@ private:
friend class MCompositeManagerExtension;
friend class MTexturePixmapPrivate;
friend class MWindowPropertyCache;
+ friend class MCompositeWindowGroup;
};
#endif
diff --git a/src/mcompositescene.cpp b/src/mcompositescene.cpp
index 56649d7..0677868 100644
--- a/src/mcompositescene.cpp
+++ b/src/mcompositescene.cpp
@@ -101,10 +101,13 @@ void MCompositeScene::drawItems(QPainter *painter, int numItems, QGraphicsItem *
// lest we can have it drawn with the transition (especially
// when desktop window is not yet shown, NB#192454)
continue;
+ if (cw->group())
+ // items that belong to a group are drawn by the group
+ continue;
if (cw->isDirectRendered() || !cw->isVisible()
|| !(cw->propertyCache()->isMapped() || cw->isWindowTransitioning())
|| cw->propertyCache()->isInputOnly())
- continue;
+ continue;
if (visible.isEmpty())
// nothing below is visible anymore
break;
diff --git a/src/mcompositewindowgroup.cpp b/src/mcompositewindowgroup.cpp
index 274c0fc..586e3fd 100644
--- a/src/mcompositewindowgroup.cpp
+++ b/src/mcompositewindowgroup.cpp
@@ -45,6 +45,7 @@
#include <mtexturepixmapitem.h>
#include <mcompositemanager.h>
+#include <mcompositemanager_p.h>
#ifdef GLES2_VERSION
#define FORMAT GL_RGBA
@@ -117,7 +118,11 @@ MCompositeWindowGroup::~MCompositeWindowGroup()
glDeleteFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
- update();
+ // if stacking is dirty, stack windows now, otherwise we paint the scene
+ // according to the old stacking
+ MCompositeManager *p = (MCompositeManager*)qApp;
+ if (p->d->stacking_timer.isActive())
+ p->d->stackingTimeout();
}
void MCompositeWindowGroup::init()
@@ -193,7 +198,7 @@ void MCompositeWindowGroup::addChildWindow(MTexturePixmapItem* window)
// for back to front rendering. Could use depth buffer attachment at some
// point so this might be unecessary
qSort(d->item_list.begin(), d->item_list.end(), behindCompare);
- updateWindowPixmap();
+ updateWindowPixmap(); // FIXME: don't do this for each added child
}
/*!