-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Popup menu does not popup at indicated location #95151
Comments
Please try with 4.2.2 to make sure this hasn't already been fixed in a supported version |
Events in %PopupMenu.popup(Rect2i(get_global_transform() * e.position, Vector2i.ZERO)) |
Note that this varies depending on whether embedded subwindows are enabled in the Project Settings (or single-window mode in the Editor Settings). This can certainly catch users off-guard, which makes me wonder if we should have a |
I've upgraded to 4.2.2 and am now using:
While this is now giving me the correct vertical position on my popped up window, the popup is on the far left of the monitor regardless of the X position of the mouse. And in my other project, the |
I've modified the code to be
I am getting this output
The popup menu is popping up on the left side of the screen: |
AFAICT it should be: %PopupMenu.popup(Rect2i(get_screen_transform() * e.position, Vector2i.ZERO)) (at least seems to work) Regarding event locality:
Regarding Lines 368 to 452 in 3978628
|
Tested versions
v4.2.1.stable.official [b09f793]
System information
v4.2.1.stable.official [b09f793]
Issue description
I am trying to write a script that causes a PopupMenu to open at the location where the user right clicks the mouse. This is an editor addon, and the popup menu is opening nowhere near the point I'm indicating. In my original program, it wasn't even opening on the correct monitor. In the test case I'm attaching, it is opening on the correct monitor, but no where near the point where the mouse is located.
Steps to reproduce
Install the attached addon to the Godot editor. Expand the
Popup Test
tab in the bottom center dock and right click in the window area. My PopupMenu will be displayed, but in the top left hand corner of the screen. I've tried lots of combinations of popup(), popup_on_parent() and show(), but the popup menu always opens relative to the top left corner of the screen, not the control.Minimal reproduction project (MRP)
popup_location.zip
The text was updated successfully, but these errors were encountered: