[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

compiz: Changes to 'upstream-unstable'



 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(-)

New commits:
commit 0ea58487fd2b0db25fae93ff08ae6680d1ad6557
Author: Dennis Kasprzyk <onestone@opencompositing.org>
Date:   Tue Jan 15 14:53:46 2008 +0100

    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.

diff --git a/kde/window-decorator/decorator.cpp b/kde/window-decorator/decorator.cpp
index df2d188..980233b 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 5165995..75f149d 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 eb4a8d3..d22cff2 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;
     };
 }


Reply to: