-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workaround qt 5.12 bug for simulated rightbutton mouse events #10869
Conversation
@@ -117,6 +122,13 @@ bool MixxxApplication::notify(QObject* target, QEvent* event) { | |||
mouseEvent->setButton(Qt::RightButton); | |||
m_rightPressedButtons++; | |||
} | |||
if (mouseEvent->button() == Qt::RightButton && mouseEvent->buttons() == Qt::LeftButton) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workarounds for specific Qt releases should be enclosed in #ifef guards and restricted to only the Qt versions that are actually affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. it also also platform specific, so i will guard that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you search the code you will find some common patterns involving QT_VERSION_CHECK
etc.
@uklotzde i have added the guards as requested. |
Qt 5.12.3 has a bug which results in missing mouse button release events for simulated right clicks (ctrl+left click). Details of the exact bug can be found here: https://mixxx.zulipchat.com/#narrow/stream/109171-development ; see comments about the call to QApplicationPrivate::pickMouseReceiver from QWidgetWindow and the call to QWindowSystemInterface::handleMouseEvent from qnsview_mouse.mm
Fixing this with a patched Qt 5.12.3 would be desirable, but this workaround allows continuing with the existing build-env for 2.3, by correcting the event when it is handled by MixxxApplication::notify(...), effectively having the same result.