summaryrefslogtreecommitdiff
path: root/kde
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2009-11-16 23:08:33 +0100
committerDennis Kasprzyk <onestone@compiz-fusion.org>2009-11-16 23:08:33 +0100
commitac3da86daeb6285a1a5340e02b0b084b5251da9f (patch)
tree8429fc2fffb3c5a01ca1d3f0f5c401eedcadcfb2 /kde
parente3467e5478e4ccb1757cd628b69462b581b5d594 (diff)
downloadzcomp-ac3da86daeb6285a1a5340e02b0b084b5251da9f.tar.gz
zcomp-ac3da86daeb6285a1a5340e02b0b084b5251da9f.tar.bz2
Initialize decoration with correct geometry of a reparented window.
Diffstat (limited to 'kde')
-rw-r--r--kde/window-decorator-kde4/decorator.cpp15
-rw-r--r--kde/window-decorator-kde4/window.cpp9
-rw-r--r--kde/window-decorator-kde4/window.h2
3 files changed, 11 insertions, 15 deletions
diff --git a/kde/window-decorator-kde4/decorator.cpp b/kde/window-decorator-kde4/decorator.cpp
index 67f4b13..72e48d8 100644
--- a/kde/window-decorator-kde4/decorator.cpp
+++ b/kde/window-decorator-kde4/decorator.cpp
@@ -624,9 +624,6 @@ KWD::Decorator::handleWindowAdded (WId id)
WId select, frame = 0;
WId oframe = 0, iframe = 0;
KWD::Window::Type type = KWD::Window::Normal;
- unsigned int width, height, border, depth;
- int x, y;
- XID root;
QWidgetList widgets;
/* avoid adding any of our own top level windows */
@@ -636,11 +633,15 @@ KWD::Decorator::handleWindowAdded (WId id)
}
KWD::trapXError ();
- XGetGeometry (QX11Info::display (), id, &root, &x, &y, &width, &height,
- &border, &depth);
+ KWindowInfo wInfo = KWindowSystem::windowInfo (id, NET::WMGeometry);
if (KWD::popXError ())
return;
+ if (!wInfo.valid ())
+ return;
+
+ QRect geometry = wInfo.geometry ();
+
KWD::readWindowProperty (id, Atoms::netInputFrameWindow, (long *) &iframe);
KWD::readWindowProperty (id, Atoms::netOutputFrameWindow, (long *) &oframe);
@@ -704,9 +705,7 @@ KWD::Decorator::handleWindowAdded (WId id)
if (!mClients.contains (id))
{
client = new KWD::Window (mCompositeWindow, id, frame, type,
- x, y,
- width + border * 2,
- height + border * 2);
+ geometry);
mClients.insert (id, client);
mFrames.insert (frame, client);
diff --git a/kde/window-decorator-kde4/window.cpp b/kde/window-decorator-kde4/window.cpp
index 129198a..850b7e1 100644
--- a/kde/window-decorator-kde4/window.cpp
+++ b/kde/window-decorator-kde4/window.cpp
@@ -66,10 +66,7 @@ KWD::Window::Window (WId parentId,
WId clientId,
WId frame,
Type type,
- int x,
- int y,
- int w,
- int h) :
+ QRect geometry) :
mType (type),
mParentId (parentId),
mFrame (0),
@@ -140,7 +137,7 @@ KWD::Window::Window (WId parentId,
updateFrame (frame);
- mGeometry = QRect (x, y, w, h);
+ mGeometry = geometry;
getWindowProtocols ();
}
@@ -1523,7 +1520,7 @@ KWD::Window::moveWindow (QMouseEvent *qme)
Decorator::rootInfo ()->restackRequest (mClientId, NET::FromApplication,
None, Above,
QX11Info::appTime());
-
+
Decorator::rootInfo ()->moveResizeRequest (mClientId,
p.x (),
p.y (),
diff --git a/kde/window-decorator-kde4/window.h b/kde/window-decorator-kde4/window.h
index 2f6f0b2..9a6dd4a 100644
--- a/kde/window-decorator-kde4/window.h
+++ b/kde/window-decorator-kde4/window.h
@@ -63,7 +63,7 @@ class Window: public QObject, public KDecorationBridgeUnstable {
public:
Window (WId parentId, WId clientId, WId frame, Type type,
- int x = 0, int y = 0, int w = 1, int h = 1);
+ QRect geometry = QRect ());
~Window (void);
virtual bool isActive (void) const;