-
-
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
Improve popup window/menu handling. #58490
Improve popup window/menu handling. #58490
Conversation
5bec7ef
to
1d24d5b
Compare
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
1d24d5b
to
74ff592
Compare
Tested on Linux X11 with Plasma/KWin, seems to work fine. |
Tested on Windows 10 (since bruvzg's screenshot was taken in W11) and it seems to work fine. It also fixes a regression where all context menus wouldn't show up anymore after a tooltip is displayed (not mentioned in #58515). |
Thanks! |
XGetWindowAttributes(x11_display, wd.x11_window, &xwa); | ||
|
||
ERR_FAIL_COND_MSG(p_window == MAIN_WINDOW_ID, "Main window can't be popup."); | ||
ERR_FAIL_COND_MSG((xwa.map_state == IsViewable) && (wd.is_popup != p_enabled), "Pupup flag can't changed while window is opened."); |
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.
There's a typo here in "Pupup" (and other 2 implementations).
if (wd_window.menu_type && !wd_window.no_focus && wd_window.focused) { | ||
if (!wd_parent.no_focus) { | ||
if (!wd_window.no_focus && !wd_window.is_popup && wd_window.focused) { | ||
if (!wd_parent.no_focus && !wd_window.is_popup) { |
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.
!wd_window.is_popup
appears twice. The second one is likely to be !wd_parent.is_popup
.
Adds a dedicated window
FLAG_POPUP
and a platform specific routines to control popup menus.Previews:
macOS:
macos.mov
Windows:
2022-02-24.12-56-08.mov
TODO:
Popup
s other than menu andOptionButton
dropdowns are functioning correctly.Fixes #53187, supersede #58461