Commit db0c3d74 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

taskmanager: Drop workaround for QTBUG-59044

The condition in ungrabMouseHack() is never satisfied, and the bug
should be fixed because QQuickWindow will get a mouseReleaseEvent in the
test case (http://static.davidedmundson.co.uk/qmlmousetest.tar.gz);
parent f962e9bd
Pipeline #207697 passed with stage
in 2 minutes and 44 seconds
......@@ -46,7 +46,6 @@ PlasmaComponents.ContextMenu {
} else if (status == PlasmaComponents.DialogStatus.Closed) {
menu.destroy();
backend.ungrabMouse(visualParent);
}
}
......
......@@ -530,32 +530,6 @@ QRect Backend::globalRect(QQuickItem *item) const
return iconRect;
}
void Backend::ungrabMouse(QQuickItem *item) const
{
// this is a workaround where Qt will fail to realize a mouse has been released
// this happens if a window which does not accept focus spawns a new window that takes focus and X grab
// whilst the mouse is depressed
// https://bugreports.qt.io/browse/QTBUG-59044
// this causes the next click to go missing
// by releasing manually we avoid that situation
auto ungrabMouseHack = [item]() {
if (item && item->window() && item->window()->mouseGrabberItem()) {
item->window()->mouseGrabberItem()->ungrabMouse();
}
};
// pre 5.8.0 QQuickWindow code is "item->grabMouse(); sendEvent(item, mouseEvent)"
// post 5.8.0 QQuickWindow code is sendEvent(item, mouseEvent); item->grabMouse()
if (QVersionNumber::fromString(QString::fromLatin1(qVersion())) > QVersionNumber(5, 8, 0)) {
QTimer::singleShot(0, item, ungrabMouseHack);
} else {
ungrabMouseHack();
}
// end workaround
}
bool Backend::windowViewAvailable() const
{
return m_windowViewAvailable;
......
......@@ -60,8 +60,6 @@ public:
Q_INVOKABLE QRect globalRect(QQuickItem *item) const;
Q_INVOKABLE void ungrabMouse(QQuickItem *item) const;
bool windowViewAvailable() const;
Q_INVOKABLE bool isApplication(const QUrl &url) const;
......
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