diff options
author | David Reveman <davidr@novell.com> | 2007-10-30 11:57:44 -0400 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2007-10-30 12:04:49 -0400 |
commit | cc3ce78a03c11d3b0fcc90d1f19866308536688b (patch) | |
tree | d0f580d416202c12be0042577ecdfbf06f8a7a12 | |
parent | 552fabed6830aec0973286d1b35844844566af95 (diff) |
Reparent window instead of flipping the WType_TopLevel bit.
-rw-r--r-- | kde/window-decorator/decorator.cpp | 9 | ||||
-rw-r--r-- | kde/window-decorator/window.cpp | 23 | ||||
-rw-r--r-- | kde/window-decorator/window.h | 2 |
3 files changed, 16 insertions, 18 deletions
diff --git a/kde/window-decorator/decorator.cpp b/kde/window-decorator/decorator.cpp index 19e10d65..93420846 100644 --- a/kde/window-decorator/decorator.cpp +++ b/kde/window-decorator/decorator.cpp @@ -299,9 +299,9 @@ KWD::Decorator::enableDecorations (Time timestamp, updateShadow (); - mDecorNormal = new KWD::Window (mCompositeWindow, qt_xrootwin (), + mDecorNormal = new KWD::Window (mCompositeWindow->winId (), qt_xrootwin (), 0, Window::Default); - mDecorActive = new KWD::Window (mCompositeWindow, qt_xrootwin (), + mDecorActive = new KWD::Window (mCompositeWindow->winId (), qt_xrootwin (), 0, Window::DefaultActive); connect (mKWinModule, SIGNAL (windowAdded (WId)), @@ -918,7 +918,8 @@ KWD::Decorator::handleWindowAdded (WId id) { if (!mClients.contains (id)) { - client = new KWD::Window (mCompositeWindow, id, frame, type, + client = new KWD::Window (mCompositeWindow->winId (), + id, frame, type, x, y, width + border * 2, height + border * 2); @@ -940,7 +941,7 @@ KWD::Decorator::handleWindowAdded (WId id) { if (!mClients.contains (id)) { - client = new KWD::Window (mCompositeWindow, id, 0, type, + client = new KWD::Window (mCompositeWindow->winId (), id, 0, type, x, y, width + border * 2, height + border * 2); diff --git a/kde/window-decorator/window.cpp b/kde/window-decorator/window.cpp index e64dbe94..568dbe61 100644 --- a/kde/window-decorator/window.cpp +++ b/kde/window-decorator/window.cpp @@ -54,14 +54,14 @@ #include <qcursor.h> #include <qpopupmenu.h> -KWD::Window::Window (QWidget *parent, - WId clientId, - WId frame, - Type type, - int x, - int y, - int w, - int h): QWidget (parent, 0), +KWD::Window::Window (WId parentId, + WId clientId, + WId frame, + Type type, + int x, + int y, + int w, + int h): QWidget (0, 0), mType (type), mFrame (0), mClientId (clientId), @@ -122,6 +122,8 @@ KWD::Window::Window (QWidget *parent, mGeometry = QRect (50, 50, 30, 1); } + XReparentWindow (qt_xdisplay (), winId (), parentId, 0, 0); + setGeometry (QRect (mGeometry.x () + ROOT_OFF_X, mGeometry.y () + ROOT_OFF_Y, mGeometry.width (), mGeometry.height ())); @@ -1159,11 +1161,6 @@ KWD::Window::resizeDecoration (bool force) mMapped = true; - /* XXX: is there a more appropriate way to achieve this? - add WType_TopLevel flag so that visualRect isn't clipped - to parent. */ - setWFlags (getWFlags () | WType_TopLevel); - if (mDamageId != winId ()) { mDamageId = winId (); diff --git a/kde/window-decorator/window.h b/kde/window-decorator/window.h index 8472677c..e9d6496e 100644 --- a/kde/window-decorator/window.h +++ b/kde/window-decorator/window.h @@ -54,7 +54,7 @@ class Window:public QWidget, public KDecorationBridge { }; public: - Window (QWidget *parent, WId clientId, WId frame, Type type, + Window (WId parentId, WId clientId, WId frame, Type type, int x = 0, int y = 0, int w = 1, int h = 1); ~Window (void); |