-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
[WIP] Wayland: Implement native sub-windows #101774
base: master
Are you sure you want to change the base?
[WIP] Wayland: Implement native sub-windows #101774
Conversation
aa9815c
to
a0c005d
Compare
When a subwindow appears, it will cause the main window to exit maximized mode. 2025-01-19.23-10-21.mp4 |
Hi @scgm0, thank you for testing! I think I know why. I'll push a fix soon. |
This will be useful for Windows/macOS/X11 display server popup auto close logic, currently these are using |
Hey that's exactly what I was trying to avoid! I'm really glad this will be useful for other backends too! :D |
@scgm0 I pushed quite a few changes, including a fix for the issue you mentioned. |
New issue, the borderless setting of the main window is not working |
Does this happen only on the main window? Because unfortunately that's a known issue with the decoration library we're using, see #93472. I had it disabled until this last push to make debugging simpler. I think I might need to find a workaround since the upstream bug report went nowhere unfortunately. |
But before you fix the maximized window, the main window can be borderless, which is a bit strange. |
It stopped working because I also pushed other things along the fix, including "Re-add libdecor support". I usually work in bursts and push everything at once. |
I see, so would libdecor support be of any benefit? |
Ye it is, as some compositors do not have their own decorations, like GNOME. We could implement our own decorations instead of using a library but it's not exactly simple. I'd like to look into that eventually though as it allows fancier features. |
7f038f5
to
ee37194
Compare
Heads up to whoever might be testing this PR: expect instability and crashes with popups in the latest batch of commits, I'm doing some experiments |
update: things should have come back to a decent state, but popups are a bit iffy when they get pushed back by the compositor, as godot tries to do some fitting itself. I'll need to find a good way to stop popups from trying to be smart. |
e2e8ba7
to
42d387f
Compare
Folks, I think I have a plan! It's quite simple, we add a feature flag for "self-fitting windows" (not a great name I know) and if that's available we avoid "adjusting" popup windows. Now things should work great! Edit (I don't want to spam too much) here's what it allows: Not bad for not having screen-space window handling :P |
88e4e9d
to
005420d
Compare
9dd6cc1
to
9228a51
Compare
5cc4ce7
to
7de2968
Compare
Heads up: I fixed an issue with child toplevels being shrunk to their minimum size. I thought it was my project metadata being funky but no, it was an issue in the window adjusting code I special cased for the new feature flag 😅 |
7de2968
to
9a2cfc6
Compare
WIP as some features are still not multiwin aware but otherwise everything seems very usable.
Thanks to all the improvements the backend got over the years, it's now finally possible to have a stable native multi-window experience.
The existing Godot API is still not compatible with all of Wayland expectations, so I distilled the bare minimum into
twothree, hopefully small enough additions:WINDOW_EVENT_FORCE_CLOSE
, which is a surefire way of cleaning up a window. It basically makes the window callhide
on itself, because the compositor might close a window (e.g. a popup) whether we like it or not. This should be useful for other platforms too.WINDOW_FLAG_POPUP_WM_HINT
, which lets the DisplayServer know that this is supposed to be a popup, as there's no failproof heuristic for that. This should also come in handy for X11 compositors as the backend has issues telling them apart too.FEATURE_SELF_FITTING_WINDOWS
, which lets nodes know that they should not try to adjust windows and popups to fit in the screen, as they don't have enough data and the compositor does that for them already. I think that this is the only addition that would be of use only for this backend.This PR includes also a lot of core improvements and fixes to stuff that became more evident while testing multiple windows, including a complete overhaul of pointer/tablet handling. I'm definitely going to backport/separate some of those. It does not even include the FIFO additions (#101454) or fixes for some leftover issues that @arlo-phoenix found in the original PR so once everything is done the Wayland experience should become even more solid.
I'll document everything properly once it's done, I plan to squash this PR and treat it properly this time.
So, yeah, keeping this here for reference and testing for whoever feels adventurous. I'll keep chipping at it in the meantime.
Here's a picture of it running on sway:
Known issues
ERROR: editor/progress_dialog.cpp:169 - Do not use progress dialog (task) while flushing the message queue or using call_deferred()!
#100900