Commit 738c0754 authored by Alexander Volkov's avatar Alexander Volkov
Browse files

Don't replay mouse press event which closes a popup on X11


Add a new style hint to QPlatformIntegration: ReplayMousePressOutsidePopup.
Return false for it in the xcb plugin.

This commit restores the behavior which was in Qt 4.

Task-number: QTBUG-34814
Change-Id: I19fee762395a51475cc67b52b368c70679ca736b
Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@digia.com>
Showing with 8 additions and 2 deletions
......@@ -392,6 +392,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return QPlatformTheme::defaultThemeHint(QPlatformTheme::MousePressAndHoldInterval);
case TabFocusBehavior:
return QPlatformTheme::defaultThemeHint(QPlatformTheme::TabFocusBehavior);
case ReplayMousePressOutsidePopup:
return true;
}
return 0;
......
......@@ -145,7 +145,8 @@ public:
SetFocusOnTouchRelease,
ShowIsMaximized,
MousePressAndHoldInterval,
TabFocusBehavior
TabFocusBehavior,
ReplayMousePressOutsidePopup
};
virtual QVariant styleHint(StyleHint hint) const;
......
......@@ -374,6 +374,8 @@ QVariant QXcbIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
// X11 always has support for windows, but the
// window manager could prevent it (e.g. matchbox)
return false;
case QPlatformIntegration::ReplayMousePressOutsidePopup:
return false;
default:
break;
}
......
......@@ -465,7 +465,8 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
}
if (qApp->activePopupWidget() != activePopupWidget
&& qt_replay_popup_mouse_event) {
&& qt_replay_popup_mouse_event
&& QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ReplayMousePressOutsidePopup).toBool()) {
if (m_widget->windowType() != Qt::Popup)
qt_button_down = 0;
if (event->type() == QEvent::MouseButtonPress) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment