Skip to content
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

Fix right click macos #6251

Merged
merged 13 commits into from
Jun 26, 2023
Merged

Fix right click macos #6251

merged 13 commits into from
Jun 26, 2023

Conversation

BenjaminDeleze
Copy link

@BenjaminDeleze BenjaminDeleze commented Jun 23, 2023

Description
Fix #6244

This issue is specific to macOS.

Since the upgrade to Qt 6.4.3, the context menu (opened with a right click) of the 3d view was not closed when clicking in the 3d view, worse it was possible to open several context menus.

The issue was not fixed by upgrading to Qt 6.5.1.

Here is what I could gather on the issue:

  • Normally, clicking anywhere (mousePressEvent) but on the context menu is supposed to close it.
  • However, on macOS it seems that clicking on the 3d view does not send the signal to the menu. Instead, the signal is send, as normally, to the 3d view itself (which can result in another menu being opened).
  • Clicking on another part of the Webots GUI like the terminal, editor, scene tree will close the menu as expected.
  • One hypothesis is that it is working anywhere excepted in the 3d view because it is the only one that is not derived from a QWidget but from a QWindow.

Fix

  • Either we revert to 6.2.3 and wait for Qt to fix the bug (as I think that it is a Qt's bug). However, I saw nobody mention this bug for Qt 6 so far. This bug was present in some version of Qt and it took them several years to fix it (see here), so I am not sure it is the best idea.

  • Or we apply the fix of this PR. The only strange behavior I remarked with this solution is that if we open a scene tree context menu and then click in the 3d view it will not close it, but if we click in the scene tree it will close it.

@BenjaminDeleze BenjaminDeleze added the bug Something isn't working label Jun 23, 2023
@BenjaminDeleze BenjaminDeleze added this to the R2023b milestone Jun 23, 2023
@BenjaminDeleze BenjaminDeleze self-assigned this Jun 23, 2023
@BenjaminDeleze BenjaminDeleze marked this pull request as ready for review June 23, 2023 14:55
@BenjaminDeleze BenjaminDeleze requested a review from a team as a code owner June 23, 2023 14:55
src/webots/gui/WbView3D.cpp Outdated Show resolved Hide resolved
Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
@BenjaminDeleze BenjaminDeleze added test sources Start the sources test on all platforms test suite Start the test suite labels Jun 23, 2023
omichel
omichel previously approved these changes Jun 23, 2023
Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@omichel omichel added test sources Start the sources test on all platforms and removed test suite Start the test suite test sources Start the sources test on all platforms labels Jun 23, 2023
Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@BenjaminDeleze BenjaminDeleze merged commit 0670c55 into master Jun 26, 2023
20 checks passed
@BenjaminDeleze BenjaminDeleze deleted the fix-right-click-macos branch June 26, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test sources Start the sources test on all platforms
Development

Successfully merging this pull request may close these issues.

Right click menu stacking up on macOS
2 participants