-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 fixes for X11 display server #41456
Conversation
From PR godotengine#38727 which was reverted in godotengine#41373 because of regressions in Ubuntu with Gnome. Co-authored-by: Lorenzo Cerqua <lorenzocerqua@tutanota.com>
Previously, only the direct parent were taken into account. Popups like contextual menus could stay open if an ancestor which is not a direct parent was focused. Reproduction steps (any platform): - Select a node in the scene tree - Left click the node to start renaming - Right click to open the copy/paste contextual menu - Left click in the scene tree to deselect the node Also closing popup when focusing out of the application, without waiting for the parent to get focus to do so.
Tested on Ubuntu (Gnome & KDE) so far. If anybody would like to help, I'm interested in feedback with different WMs to make sure these changes don't introduce any critical regression. |
Now using override_redirect for menu & tooltip popups to prevent the WM from interfering with them, so we have more control over focus management and avoid a delay before they show up.
On Windows, WINDOW_EVENT_FOCUS_IN was never sent by the display server for popups, because WM_ACTIVATE events are received during the call to _update_window_style, which happened before the callbacks were set. This was causing some issues with the way Popup is now handling closing on parent focus. Now _update_window_style is only called during show_window, after Window initialized callbacks.
4cbb56c
to
bb30675
Compare
Pushed some modifications in X11 display server to solve some focus issues with XFCE, along with code cleaning and extra comments. |
Extra tests with a tiling WM: |
I can confirm freezing on i3 too. |
@Riteo Thanks for checking. Were you experiencing it before? I can reproduce it on latest master, but I'm not sure if it's a recent issue. |
Why not bisecting this issue? Soon I should be able to do that. |
After a lot of tests, I couldn't pinpoint the exact reason of the freeze. As of now I tried on Arch Linux with i3 running a build of commit d670a49 to:
Other things to try would be running Godot on other tiling WMs, rolling back any other possibly related package and maybe debugging any weird output on i3's debug log(thing which I'll try to do as soon as I can, but lately I'm getting very slowed down due to personal reasons). Still, I'm reading a lot of X11 documentation and questioning some choices done in the X11 DisplayServer implementation, thing which I would like to discuss eventually on IRC with @reduz and whoever worked on it(I really don't want to sound rude, there is surely some technical reason behind those choices and I would like to know why some things are made in a certain way in order to contribute with code that doesn't go against them). It's 4 AM here and I'm very tired so I think that I'll stop for now. |
Thanks for all the info. I'm currently contracting to work on the X11 display server, so I'm responsible for this topic. We can talk about your concerns directly, either here or on IRC. About the freezing issues with i3, I've added it to my list but it's on a lower priority for me since the goal is to first make the display server work correctly with standard WMs. |
#40024 this is an issue on ctwm (and probably twm too), although it has not been introduced by this PR. It may still be related since it was introduced with the 4.0 changes to popups. Godot either
|
I think we should make a separate issue for this freezing, as it doesn't seem related to this PR.
@pouleyKetchoupp I would like to not go too much off topic on this PR page, but this weekend i should be a little more free, maybe we could talk about it then on IRC?
@Meriipu I don't think so, since this freezing issue started arising only very recently, at least only on i3. |
@Riteo I've just opened a separate issue for the freezing in i3. |
This seems to work perfectly on openbox (archlinux). |
Thanks! |
This PR fixes some issues with popups showing with a delay on linux, and also does a few general changes in how Popup nodes are handling focus changes.
Also fixes #37674, fixes #41578
Re-apply "Fixes for windows in X11 tiling WMs"
From PR #38727 by @Riteo which was reverted in #41373 because of regressions in Ubuntu with Gnome.
Regressions are now fixed with the other popup changes in this PR.
Fix popup closed when an ancestor window is focused
This is a general change for
Popup
which fixes issues that affect all platforms.Previously, only the direct parent were taken into account.
Popups like contextual menus could stay open if an ancestor which is not a direct parent was focused.
Reproduction steps (any platform):
Also closing popup when focusing out of the application, without waiting for the parent to get focus to do so.
Fix menu popups delay and focus in X11 display server
This is a fix for a linux specific issue with popups. Contextual menus, top bar menus and editable properties were showing with a delay due to some extra time to be initialized in the windows manager.
Now using
override_redirect
for all utility popups to prevent the WM from interfering with them, so we have more control over focus management and avoid a delay before they show up.Fix WINDOW_EVENT_FOCUS_IN for popups on Windows
This is a fix for Windows, needed because of the changes in
Popup
in this PR.On Windows,
WINDOW_EVENT_FOCUS_IN
was never sent by the display server for popups, becauseWM_ACTIVATE
events are received during the call to_update_window_style
, which happened before the callbacks were set.This was causing some issues with the way
Popup
is now handling closing on parent focus.Now
_update_window_style
is only called during show_window, after Window initialized callbacks.