diff options
author | Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> | 2010-10-13 11:05:09 +0300 |
---|---|---|
committer | Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> | 2010-10-13 11:06:46 +0300 |
commit | dd21162c2b84005607a53a8da52374a9716631b5 (patch) | |
tree | c3345b426caf83e7e0d74e3e7beed74afe7574f3 | |
parent | d12b53c820fc6ed17211a4ef6af059143e57c7de (diff) |
emit currentAppChanged also when stacking order changes to allow the signal
listener to track the transients
-rw-r--r-- | src/mcompositemanager.cpp | 12 | ||||
-rw-r--r-- | src/mcompositemanager_p.h | 2 | ||||
-rw-r--r-- | src/mcompositescene.cpp | 2 | ||||
-rw-r--r-- | src/mtexturepixmapitem_egl.cpp | 1 |
4 files changed, 12 insertions, 5 deletions
diff --git a/src/mcompositemanager.cpp b/src/mcompositemanager.cpp index 87af714..900ccb1 100644 --- a/src/mcompositemanager.cpp +++ b/src/mcompositemanager.cpp @@ -1795,11 +1795,17 @@ void MCompositeManagerPrivate::setupButtonWindows(Window curr_app) } } -void MCompositeManagerPrivate::setCurrentApp(Window w) +void MCompositeManagerPrivate::setCurrentApp(Window w, + bool stacking_order_changed) { static Window prev = (Window)-1; - if (prev == w) + if (prev == w) { + if (stacking_order_changed) + // signal listener could be interested in transients of + // the current application (could be also different signal?) + emit currentAppChanged(current_app); return; + } XChangeProperty(QX11Info::display(), RootWindow(QX11Info::display(), 0), ATOM(_MEEGOTOUCH_CURRENT_APP_WINDOW), XA_WINDOW, 32, PropModeReplace, (unsigned char *)&w, 1); @@ -2092,7 +2098,7 @@ void MCompositeManagerPrivate::checkStacking(bool force_visibility_check, setWindowState(cw->window(), NormalState); } } - setCurrentApp(set_as_current_app); + setCurrentApp(set_as_current_app, order_changed); } void MCompositeManagerPrivate::stackingTimeout() diff --git a/src/mcompositemanager_p.h b/src/mcompositemanager_p.h index fb27c9a..e2750e1 100644 --- a/src/mcompositemanager_p.h +++ b/src/mcompositemanager_p.h @@ -116,7 +116,7 @@ public: static bool compareWindows(Window w_a, Window w_b); void roughSort(); - void setCurrentApp(Window w); + void setCurrentApp(Window w, bool stacking_order_changed); void raiseTransientsOf(MWindowPropertyCache *pc, int last_i, bool recursion = false); diff --git a/src/mcompositescene.cpp b/src/mcompositescene.cpp index 49f1931..617d6b0 100644 --- a/src/mcompositescene.cpp +++ b/src/mcompositescene.cpp @@ -123,7 +123,7 @@ void MCompositeScene::drawItems(QPainter *painter, int numItems, QGraphicsItem * // FIXME: this region is always the same as the window's shape, // some transformations would be needed... - QRegion r(cw->sceneMatrix().map(cw->propertyCache()->shapeRegion())); + QRegion r(cw->propertyCache()->shapeRegion()); // transitioning window can be smaller than shapeRegion(), so paint // all transitioning windows diff --git a/src/mtexturepixmapitem_egl.cpp b/src/mtexturepixmapitem_egl.cpp index f834d83..9272452 100644 --- a/src/mtexturepixmapitem_egl.cpp +++ b/src/mtexturepixmapitem_egl.cpp @@ -165,6 +165,7 @@ void MTexturePixmapItem::rebindPixmap() { if (!d->custom_tfp && d->egl_image != EGL_NO_IMAGE_KHR) { eglDestroyImageKHR(d->eglresource->dpy, d->egl_image); + d->egl_image = EGL_NO_IMAGE_KHR; glBindTexture(GL_TEXTURE_2D, 0); } |