diff options
author | Adam Endrodi <ext-adam.endrodi@nokia.com> | 2010-12-08 12:16:03 +0200 |
---|---|---|
committer | Adam Endrodi <ext-adam.endrodi@nokia.com> | 2010-12-14 16:24:09 +0200 |
commit | 40756264e00955980a0616b263ef713580a45f68 (patch) | |
tree | c73538b97d9441e9d6141fbe47afb96ceda0dc60 | |
parent | d913618945a385ead8b92ee187934414bb5377c3 (diff) |
facility to trace window sizing
* src/mcompositordebug.h:
New switch to enable tracing of XConfigureWindow()s, XResizeWindow()s,
and XMoveResizeWindow()s.
* src/mcompositemanager.cpp
* src/mdecoratorframe.cpp:
Use them.
-rw-r--r-- | src/mcompositemanager.cpp | 6 | ||||
-rw-r--r-- | src/mcompositordebug.h | 20 | ||||
-rw-r--r-- | src/mdecoratorframe.cpp | 5 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/mcompositemanager.cpp b/src/mcompositemanager.cpp index 28c3f40..edc81ea 100644 --- a/src/mcompositemanager.cpp +++ b/src/mcompositemanager.cpp @@ -27,6 +27,7 @@ #include "mdevicestate.h" #include "mcompositemanagerextension.h" #include "mcompmgrextensionfactory.h" +#include "mcompositordebug.h" #include <mrmiserver.h> #include <QX11Info> @@ -484,6 +485,7 @@ static void fullscreen_wm_state(MCompositeManagerPrivate *priv, int xres = ScreenOfDisplay(dpy, DefaultScreen(dpy))->width; int yres = ScreenOfDisplay(dpy, DefaultScreen(dpy))->height; XMoveResizeWindow(dpy, window, 0, 0, xres, yres); + MOVE_RESIZE(window, 0, 0, xres, yres); MCompositeWindow *win = priv->windows.value(window, 0); if (win) { win->propertyCache()->setRequestedGeometry(QRect(0, 0, xres, yres)); @@ -1408,6 +1410,7 @@ void MCompositeManagerPrivate::configureWindow(MCompositeWindow *cw, wc.sibling = e->above; wc.stack_mode = e->detail; XConfigureWindow(QX11Info::display(), e->window, value_mask, &wc); + RECONFIG(e->window, value_mask, e->x, e->y, wc.width, wc.height); } } @@ -1444,6 +1447,7 @@ void MCompositeManagerPrivate::configureRequestEvent(XConfigureRequestEvent *e) wc.sibling = e->above; wc.stack_mode = e->detail; XConfigureWindow(QX11Info::display(), e->window, value_mask, &wc); + RECONFIG(e->window, value_mask, e->x, e->y, e->width, e->height); } // store configure request for handling it at window mapping time QList<XConfigureRequestEvent*> def; @@ -1501,6 +1505,7 @@ void MCompositeManagerPrivate::mapRequestEvent(XMapRequestEvent *e) || wtype == MCompAtoms::INPUT) { if (a.width() != xres && a.height() != yres) { XResizeWindow(dpy, e->window, xres, yres); + RESIZE(e->window, xres, yres); } } @@ -1566,6 +1571,7 @@ void MCompositeManagerPrivate::mapRequestEvent(XMapRequestEvent *e) frame->setAttribute(Qt::WA_TranslucentBackground); QSize s = frame->suggestedWindowSize(); XResizeWindow(QX11Info::display(), e->window, s.width(), s.height()); + RESIZE(e->window, s.width(), s.height()); XReparentWindow(QX11Info::display(), frame->winId(), RootWindow(QX11Info::display(), 0), 0, 0); diff --git a/src/mcompositordebug.h b/src/mcompositordebug.h new file mode 100644 index 0000000..654b6ff --- /dev/null +++ b/src/mcompositordebug.h @@ -0,0 +1,20 @@ +#ifndef MCOMPOSITOR_DEBUG_H +#define MCOMPOSITOR_DEBUG_H + +// Enable to see when and how windows are sized. +#if 0 +# define RESIZE(win, w, h) \ + qDebug("%s:%u: 0x%lx -> %dx%d", __FILE__, __LINE__, (win), (w), (h)) +# define MOVE_RESIZE(win, x, y, w, h) \ + qDebug("%s:%u: 0x%lx -> %dx%d%+d%+d", __FILE__, __LINE__, \ + (win), (w), (h), (x), (y)) +# define RECONFIG(win, x, y, w, h, mask) \ + qDebug("%s:%u: 0x%lx -> %dx%d%+d%+d [0x%x]", __FILE__, __LINE__, \ + (win), (w), (h), (x), (y), (mask)) +#else +# define RESIZE(...) /* NOP */ +# define MOVE_RESIZE(...) /* NOP */ +# define RECONFIG(...) /* NOP */ +#endif + +#endif diff --git a/src/mdecoratorframe.cpp b/src/mdecoratorframe.cpp index a6e91f0..bd7012c 100644 --- a/src/mdecoratorframe.cpp +++ b/src/mdecoratorframe.cpp @@ -21,6 +21,7 @@ #include "mcompositewindow.h" #include "mtexturepixmapitem.h" #include "mcompositemanager.h" +#include "mcompositordebug.h" #include <mrmiclient.h> #include <QX11Info> @@ -164,9 +165,11 @@ void MDecoratorFrame::setDecoratorAvailableRect(const QRect& r) available_rect = r; - if (client->propertyCache()->realGeometry() != available_rect) + if (client->propertyCache()->realGeometry() != available_rect) { // resize app window to occupy the free area XMoveResizeWindow(dpy, client->window(), r.x(), r.y(), r.width(), r.height()); + MOVE_RESIZE(client->window(), r.x(), r.y(), r.width(), r.height()); + } } void MDecoratorFrame::setAutoRotation(bool mode) |