diff options
author | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-02-13 12:30:33 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-02-15 11:12:39 +0000 |
commit | 6342c4a1836f76db43e09a89239d73eda44f414a (patch) | |
tree | 36c4f8440610eeb575a375efd547c8a571f444af /src | |
parent | a945124a4212238f4d752ff2f2f3065c5adc1655 (diff) |
iOS: only flush non-user input events from layoutSubviews
Change a4e1c15b1 will cause setGeometry to take immediate effect
by doing a synchronuous layout and a flush. As a side-effect, the
flush will also send posted touch events. So if the current
setGeometry call comes from a touchMove, a touchEnd might
be delivered before the touchMove returns.
A crash in QToolBar drag-n-drop is seen from this. There
drag data is deleted on mouse release (during the flush), while
a mouse move is already handled on the stack. When the code returns
to the move handler, drag-data has been deleted, and we have a crash.
Since the root problem is that we flush events on a callback from
the app, we can be more careful and precise by only flushing non-user
input events from layoutSubviews.
Change-Id: I3f5e025d774d21509ef837de9d7e85a1ac6e48cc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/ios/quiview.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index c4b92618b1..19b2668a95 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -146,8 +146,9 @@ QRect previousGeometry = requestedGeometry != actualGeometry ? requestedGeometry : qt_window_private(m_qioswindow->window())->geometry; - QWindowSystemInterface::handleGeometryChange(m_qioswindow->window(), actualGeometry, previousGeometry); - QWindowSystemInterface::flushWindowSystemEvents(); + QWindow *window = m_qioswindow->window(); + QWindowSystemInterface::handleGeometryChange(window, actualGeometry, previousGeometry); + QWindowSystemInterface::flushWindowSystemEvents(window->inherits("QWidgetWindow") ? QEventLoop::ExcludeUserInputEvents : QEventLoop::AllEvents); if (actualGeometry.size() != previousGeometry.size()) { // Trigger expose event on resize |