diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-05-31 13:38:42 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-05-31 13:50:30 +0200 |
commit | bc75a8963ec96fb4131192bf81e60464e6533931 (patch) | |
tree | 560294a23257f95bcef1a87eb47359af3ab4bd42 /src/widgets/kernel/qwidget_qpa.cpp | |
parent | 7db1f8fc0444787690a2d981988e174c58fe1750 (diff) |
Fix for excess creation of QWindow instances.
topData() is called from various functions for any kind of widgets,
not just for top-levels. Therefore createTLSysExtra cannot assume
that the widget is top-level. Previously QWindows were created
for desktop widget, toolbars, mdi subwindows, etc. which is
wrong. The patch will avoid this, and will also fix drawing
isses when dragging mdi windows.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/widgets/kernel/qwidget_qpa.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 685965442b..ebd618057c 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -760,7 +760,9 @@ void QWidgetPrivate::createTLSysExtra() { Q_Q(QWidget); extra->topextra->screenIndex = 0; - extra->topextra->window = new QWidgetWindow(q); + extra->topextra->window = 0; + if ((q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) && q->windowType() != Qt::Desktop) + extra->topextra->window = new QWidgetWindow(q); } void QWidgetPrivate::deleteTLSysExtra() |