diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-09-07 14:33:09 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-09-07 14:36:11 (GMT) |
commit | 8fbcf5d1a93f50fa59f650468d203115f7a6965b (patch) | |
tree | 8ca09f92f659bb36930c5febc3294d06ea48d5be /src | |
parent | 8a92433b5deb14a27457715241b14764c28ffb39 (diff) | |
download | Qt-8fbcf5d1a93f50fa59f650468d203115f7a6965b.zip Qt-8fbcf5d1a93f50fa59f650468d203115f7a6965b.tar.gz Qt-8fbcf5d1a93f50fa59f650468d203115f7a6965b.tar.bz2 |
Lighthouse: fix reparenting from topLevel to child widget
also fix Directfb with a hack so that moving windows works
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget_qpa.cpp | 18 | ||||
-rw-r--r-- | src/plugins/platforms/directfb/qdirectfbwindow.cpp | 8 | ||||
-rw-r--r-- | src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp | 2 |
3 files changed, 19 insertions, 9 deletions
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index b3599bd..ac8b37d 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -145,12 +145,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) } } if (destroyWindow) { - QTLWExtra *topData = d->maybeTopData(); - if (topData) { - delete topData->platformWindow; - topData->platformWindow = 0; - d->data.winid = 0; - } + d->deleteTLSysExtra(); } else { if (parentWidget() && parentWidget()->testAttribute(Qt::WA_WState_Created)) { d->hide_sys(); @@ -403,9 +398,10 @@ void QWidgetPrivate::show_sys() window->setGeometry(geomRect); } if (q->isWindow()) { - if (QWindowSurface *surface = q->windowSurface()) + if (QWindowSurface *surface = q->windowSurface()) { if (windowRect.size() != geomRect.size()) { - surface->resize(geomRect.size()); + surface->resize(geomRect.size()); + } } if (window) @@ -781,6 +777,7 @@ void QWidgetPrivate::createSysExtra() void QWidgetPrivate::deleteSysExtra() { + } void QWidgetPrivate::createTLSysExtra() @@ -789,6 +786,11 @@ void QWidgetPrivate::createTLSysExtra() void QWidgetPrivate::deleteTLSysExtra() { + if (extra && extra->topextra) { + delete extra->topextra->platformWindow; + extra->topextra->platformWindow = 0; + extra->topextra->backingStore.destroy(); + } } void QWidgetPrivate::registerDropSite(bool on) diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp index f82fbd6..21eefc4 100644 --- a/src/plugins/platforms/directfb/qdirectfbwindow.cpp +++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp @@ -44,6 +44,8 @@ #include <QWidget> +#include "qdirectfbwindowsurface.h" + #include <directfb.h> QDirectFbWindow::QDirectFbWindow(QWidget *tlw, QDirectFbInput *inputhandler) @@ -95,10 +97,16 @@ QDirectFbWindow::~QDirectFbWindow() void QDirectFbWindow::setGeometry(const QRect &rect) { + bool isMoveOnly = (rect.topLeft() != geometry().topLeft()) && (rect.size() == geometry().size()); QPlatformWindow::setGeometry(rect); m_dfbWindow->SetBounds(m_dfbWindow, rect.x(),rect.y(), rect.width(), rect.height()); + //Hack. When moving since the WindowSurface of a window becomes invalid when moved + if (isMoveOnly) { //if resize then windowsurface is updated. + widget()->windowSurface()->resize(rect.size()); + widget()->update(); + } } void QDirectFbWindow::setOpacity(qreal level) diff --git a/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp b/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp index 271d061..2aef70d 100644 --- a/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/platforms/directfb/qdirectfbwindowsurface.cpp @@ -70,7 +70,7 @@ QDirectFbWindowSurface::QDirectFbWindowSurface(QWidget *window, WId wId) QDirectFbWindowSurface::~QDirectFbWindowSurface() { - + delete m_pixmap; } QPaintDevice *QDirectFbWindowSurface::paintDevice() |