From 0ea58487fd2b0db25fae93ff08ae6680d1ad6557 Mon Sep 17 00:00:00 2001 From: Dennis Kasprzyk Date: Tue, 15 Jan 2008 14:53:46 +0100 Subject: Wait for the proper configure (and map) events before rebinding the decoration pixmap. - On some systems the decoration widget window gets mapped first and resized after the map. KWD used a wrong window pixmap in this case. --- kde/window-decorator/decorator.cpp | 2 +- kde/window-decorator/window.cpp | 20 +++++++++++++------- kde/window-decorator/window.h | 3 ++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/kde/window-decorator/decorator.cpp b/kde/window-decorator/decorator.cpp index df2d1880..980233b3 100644 --- a/kde/window-decorator/decorator.cpp +++ b/kde/window-decorator/decorator.cpp @@ -589,7 +589,7 @@ KWD::Decorator::x11EventFilter (XEvent *xevent) else break; - if (client->handleConfigure ()) + if (client->handleConfigure (QSize (xce->width, xce->height))) { if (!mIdleTimer.isActive ()) mIdleTimer.start (0, TRUE); diff --git a/kde/window-decorator/window.cpp b/kde/window-decorator/window.cpp index 51659957..75f149d2 100644 --- a/kde/window-decorator/window.cpp +++ b/kde/window-decorator/window.cpp @@ -1144,15 +1144,18 @@ KWD::Window::resizeDecoration (bool force) mPicture = 0; } + if (w != width() || h != height()) + { + mPendingConfigure = 1; + } + setGeometry (QRect (mGeometry.x () + ROOT_OFF_X - mBorder.left, mGeometry.y () + ROOT_OFF_Y - mBorder.top, w, h)); - if (mMapped) - { - mPendingConfigure++; - } - else + mSize = QSize (w, h); + + if (!mMapped) { mPendingMap = 1; @@ -1219,12 +1222,15 @@ KWD::Window::handleMap (void) } bool -KWD::Window::handleConfigure (void) +KWD::Window::handleConfigure (QSize size) { if (!mPendingConfigure) return FALSE; - mPendingConfigure--; + if (size != mSize) + return FALSE; + + mPendingConfigure = 0; if (mPendingConfigure || mPendingMap) return FALSE; diff --git a/kde/window-decorator/window.h b/kde/window-decorator/window.h index eb4a8d3e..d22cff2d 100644 --- a/kde/window-decorator/window.h +++ b/kde/window-decorator/window.h @@ -156,7 +156,7 @@ class Window:public QWidget, public KDecorationBridge { mDamage += QRegion (x, y, w, h); } bool handleMap (void); - bool handleConfigure (void); + bool handleConfigure (QSize size); void processDamage (void); decor_context_t *context (void) { @@ -235,6 +235,7 @@ class Window:public QWidget, public KDecorationBridge { bool mMapped; int mPendingMap; int mPendingConfigure; + QSize mSize; KProcess *mProcessKiller; }; } -- cgit v1.2.3