diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-10-14 11:26:03 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-10-14 11:26:03 (GMT) |
commit | 58073ea549f50b8de46902e45c111473a5c8d9fa (patch) | |
tree | 3e72189f3ac7697fa3552273d1a2e91bff8befe6 /src/plugins/graphicssystems/testlite | |
parent | 9a5fce0d7d66e0635678eb129f765b39ea11e600 (diff) | |
download | Qt-58073ea549f50b8de46902e45c111473a5c8d9fa.zip Qt-58073ea549f50b8de46902e45c111473a5c8d9fa.tar.gz Qt-58073ea549f50b8de46902e45c111473a5c8d9fa.tar.bz2 |
Repaint when window is resized.
Some of this ought to be done in Qt, and should not be the responsibility
of the plugin.
Diffstat (limited to 'src/plugins/graphicssystems/testlite')
3 files changed, 21 insertions, 3 deletions
diff --git a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp index bec0b60..087fb1c 100644 --- a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp +++ b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp @@ -89,13 +89,26 @@ void QTestLiteWindowSurface::flush(QWidget *widget, const QRegion ®ion, const xw->paintEvent(); } -void QTestLiteWindowSurface::setGeometry(const QRect &rect) + +void QTestLiteWindowSurface::geometryChanged(const QRect &rect) { - //qDebug() << "QTestLiteWindowSurface::setGeometry:" << rect << xw->window; QWindowSurface::setGeometry(rect); - if (xw->img.size() != rect.size()) + if (xw->img.size() != rect.size()) { xw->img = QImage(rect.size(), mScreen->format()); + window()->update(); //### this is the wrong place for this... + } + +} + + +void QTestLiteWindowSurface::setGeometry(const QRect &rect) +{ + QRect oldRect = geometry(); + if (rect == oldRect) + return; + + QTestLiteWindowSurface::geometryChanged(rect); //if unchanged ### // xw->setSize(rect.width(), rect.height()); @@ -212,6 +225,7 @@ void QTestLiteWindowSurface::handleMouseEvent(QEvent::Type type, void *ev) void QTestLiteWindowSurface::handleGeometryChange(int x, int y, int w, int h) { + geometryChanged(QRect(x,y,w,h)); QApplicationPrivate::handleGeometryChange(window(), QRect(x,y,w,h)); } diff --git a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h index 7edc448..44a8d57 100644 --- a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h +++ b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h @@ -62,6 +62,7 @@ public: QPaintDevice *paintDevice(); void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); void setGeometry(const QRect &rect); + void geometryChanged(const QRect &rect); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion ®ion); diff --git a/src/plugins/graphicssystems/testlite/x11util.cpp b/src/plugins/graphicssystems/testlite/x11util.cpp index 41767c9..d744e28 100644 --- a/src/plugins/graphicssystems/testlite/x11util.cpp +++ b/src/plugins/graphicssystems/testlite/x11util.cpp @@ -450,6 +450,9 @@ void MyWindow::resizeEvent(XConfigureEvent *e) width = e->width; height = e->height; +#ifdef MYX11_DEBUG + qDebug() << hex << window << dec << "ConfigureNotify" << e->x << e->y << e->width << e->height << "geometry" << xpos << ypos << width << height; +#endif windowSurface->handleGeometryChange(xpos, ypos, width, height); } |