diff options
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow.cpp')
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 51e484202d..4165232c47 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -634,7 +634,8 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) receiver = qt_button_down; else if(popupChild) receiver = popupChild; - QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers()); + const QPoint localPos = receiver->mapFromGlobal(event->globalPos()); + QContextMenuEvent e(QContextMenuEvent::Mouse, localPos, event->globalPos(), event->modifiers()); QApplication::forwardEvent(receiver, &e, event); } #else @@ -739,8 +740,12 @@ bool QWidgetWindow::updateSize() void QWidgetWindow::updateMargins() { - const QMargins margins = frameMargins(); + // QTBUG-79147 (Windows): Bail out on resize events after closing a dialog + // and destroying the platform window which would clear the margins. QTLWExtra *te = m_widget->d_func()->topData(); + if (te->window == nullptr || te->window->handle() == nullptr) + return; + const QMargins margins = frameMargins(); te->posIncludesFrame= false; te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom()); m_widget->data->fstrut_dirty = false; |