summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDyami Caliri <dyami@dragonframe.com>2014-09-16 09:35:11 -0700
committerDyami Caliri <dyami@dragonframe.com>2014-09-19 19:15:42 +0200
commit75e5ffe0f71bfccd6ae31d1b437dfea58bfb28a7 (patch)
tree930a8726a86e43206acf74f295ea5b5e57b899b3 /src
parented167dcb727f71c585a0f3c9840dc8e57ae28139 (diff)
Update widget winId when screen changes
When a window's screen changes it may recreate the platform window. In that case, update the winId in the widget to keep it in sync. Task-number: QTBUG-40681 Change-Id: Iec815320214832bb63952de3a5bd1340a04dacd4 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 65978ef562..8d1a24a4ec 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -9042,6 +9042,12 @@ bool QWidget::event(QEvent *event)
event->ignore();
break;
#endif
+ case QEvent::ScreenChangeInternal:
+ if (const QTLWExtra *te = d->maybeTopData()) {
+ const QWindow *win = te->window;
+ d->setWinId((win && win->handle()) ? win->handle()->winId() : 0);
+ }
+ break;
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();