summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_x11.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-19 16:22:27 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-19 16:30:12 (GMT)
commit1d506981bcc3d2b8aad67989fd7946a0ad826856 (patch)
tree32d9d5e2333b914f236f638d1e236966edacd261 /src/gui/kernel/qwidget_x11.cpp
parent8c56170a03bb7ce21d875a1f12561ead799ff209 (diff)
downloadQt-1d506981bcc3d2b8aad67989fd7946a0ad826856.zip
Qt-1d506981bcc3d2b8aad67989fd7946a0ad826856.tar.gz
Qt-1d506981bcc3d2b8aad67989fd7946a0ad826856.tar.bz2
Do not create native window handle just because a parent has one.
On X11 when creating a widget that has a parent, there is no reason to create a native window handle right away since we don't know yet if the window is going to be ever shown. Task-number: QTBUG-9215 Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui/kernel/qwidget_x11.cpp')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index ece4be4..47f91f8 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1166,7 +1166,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
adjustFlags(data.window_flags, q);
// keep compatibility with previous versions, we need to preserve the created state
// (but we recreate the winId for the widget being reparented, again for compatibility)
- if (wasCreated || (!q->isWindow() && parent->testAttribute(Qt::WA_WState_Created)))
+ if (wasCreated)
createWinId();
if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden)
q->setAttribute(Qt::WA_WState_Hidden);