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

Right-click issue with context menu on map objects #2693

Closed
colin29 opened this issue Dec 10, 2019 · 5 comments
Closed

Right-click issue with context menu on map objects #2693

colin29 opened this issue Dec 10, 2019 · 5 comments
Labels
Projects

Comments

@colin29
Copy link

@colin29 colin29 commented Dec 10, 2019

Steps to duplicate:

  1. Right-click an object on the object layer while using the Select Objects or Edit Polygons Tool. On right mouse button-up, the program will always select any option that was under your cursor.

If you drag the mouse away and let go of the RMB, most of the time the context menu will disappear, but not always.

Happened to me on Win10, haven't confirmed with any other machine, but I'm pretty sure my mouse is working properly.

Work around: When selecting objects, you need to hold the right key down, find what option you are looking for, then let go of the right mouse button.

@bjorn

This comment has been minimized.

Copy link
Owner

@bjorn bjorn commented Dec 10, 2019

  1. Right-click an object on the object layer while using the Select Objects or Edit Polygons Tool. On right mouse button-up, the program will always select any option that was under your cursor.

This is the expected behavior for context menus as well as normal menus, so I think there might be some other issue. Could it be that the first option is already under the cursor when the menu opens? If so that'd be a bug.

If you drag the mouse away and let go of the RMB, most of the time the context menu will disappear, but not always.

The menu is not expected to disappear just by dragging the mouse away. Is that really happening? Normally a context menu closes when you click outside of the menu, not when releasing the mouse (unless you release while hovering one of the options).

@colin29

This comment has been minimized.

Copy link
Author

@colin29 colin29 commented Dec 10, 2019

This is the expected behavior for context menus as well as normal menus, so I think there might be some other issue. Could it be that the first option is already under the cursor when the menu opens? If so that'd be a bug.

Oh, I see. Yeah, that's the problem then. The first option is frequently already underneath the cursor.

The menu is not expected to disappear just by dragging the mouse away. Is that really happening? Normally a context menu closes when you click outside of the menu, not when releasing the mouse (unless you release while hovering one of the options).

Yeap. I tested it again, and it seems like the menu disappears if a menu option was ever highlighted (whether by normally moving cursor or the aforementioned bug). The normal menus are the same. It really isn't an issue though, if the option-under-cursor problem gets fixed.

@bjorn bjorn added windows bug labels Dec 10, 2019
@bjorn

This comment has been minimized.

Copy link
Owner

@bjorn bjorn commented Dec 10, 2019

Alright, just wondering, but is Tiled 1.2 also affected by this issue or is it new in Tiled 1.3? Tiled 1.2 was using Qt 5.9 whereas Tiled 1.3 uses Qt 5.12, and it sounds like it may be an issue in Qt.

@bjorn

This comment has been minimized.

Copy link
Owner

@bjorn bjorn commented Dec 12, 2019

I see this problem as well on Windows and noticed that it doesn't appear to happen when using the "Native" style (see Edit > Preferences > Theme > Style).

So there may be an issue with the "Tiled Fusion" style causing this. I'll look into it next week.

@bjorn bjorn modified the milestone: Tiled 1.4 Dec 12, 2019
@bjorn bjorn added this to Tiled 1.3 (bugfixes) in Roadmap Dec 12, 2019
@bjorn bjorn closed this in 1f8480a Jan 22, 2020
Roadmap automation moved this from Tiled 1.3 (bugfixes) to Recently Completed Jan 22, 2020
@bjorn

This comment has been minimized.

Copy link
Owner

@bjorn bjorn commented Jan 22, 2020

I've looked into this issue and Qt's own "Fusion" style is showing the same issue on Windows. I think it's related to the DPI scaling, but looking through the relevant code I couldn't find out what could be causing it.

So I've added a workaround instead. The menus now have a 2 pixel margin, which prevents the first item from sometimes being right below the mouse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Roadmap
  
Recently Completed
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.