diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-22 12:07:16 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-09-05 04:55:10 +0000 |
commit | c8a6b4278b04ff3ffb4484a3cf17cf4638dbadb4 (patch) | |
tree | 58e587e842d38237eafa33c1827226797754ce5b /src/plugins/platforms/winrt | |
parent | 75ef5859b6b249726e10a0d407d8d86d2f6e25a1 (diff) |
winrt: Exclude user events when adding/removing windows
Handling user events while creating a window can cause problems and
crashes as the event tries to access non initialized parts of the window
itself being created. Hence exclude user input events at that time and
have them handled when the event loop checks for them regularly.
Change-Id: I2a78efd619250be8f6f2e737ed78e39481a4cf76
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/winrt')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index dd2ebee3d5..3be17b0180 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -767,7 +767,7 @@ void QWinRTScreen::addWindow(QWindow *window) updateWindowTitle(window->title()); QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason); handleExpose(); - QWindowSystemInterface::flushWindowSystemEvents(); + QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); #if _MSC_VER >= 1900 && !defined(QT_NO_DRAGANDDROP) QWinRTDrag::instance()->setDropTarget(window); @@ -785,7 +785,7 @@ void QWinRTScreen::removeWindow(QWindow *window) if (wasTopWindow) QWindowSystemInterface::handleWindowActivated(Q_NULLPTR, Qt::OtherFocusReason); handleExpose(); - QWindowSystemInterface::flushWindowSystemEvents(); + QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); #if _MSC_VER >= 1900 && !defined(QT_NO_DRAGANDDROP) if (wasTopWindow) QWinRTDrag::instance()->setDropTarget(topWindow()); |