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

UI elements stop working under Wayland. #91632

Open
Oglo12 opened this issue May 6, 2024 · 5 comments
Open

UI elements stop working under Wayland. #91632

Oglo12 opened this issue May 6, 2024 · 5 comments

Comments

@Oglo12
Copy link

Oglo12 commented May 6, 2024

Tested versions

  • Reproducible in: 4.2.1.stable.arch_linux

System information

(Provided Via The Help -> Copy System Info) Godot v4.2.1.stable unknown - EndeavourOS #1 SMP PREEMPT_DYNAMIC Wed, 17 Apr 2024 15:20:28 +0000 - Wayland - Vulkan (Forward+) - integrated AMD Radeon Graphics (RADV REMBRANDT) () - AMD Ryzen 7 6800U with Radeon Graphics (16 Threads)

Issue description

In Godot, when I use the engine, there are times where the UI just stops working. I have concluded that this is a Wayland issue. Essentially, when I need to do something like change the colors of the editor, I need to click over and over again to get the color picker to show up. And when I try to input a color, it barely works. Sometimes it lets me change the color, and sometimes I can only delete one letter in the color input, and then just not interact with it. It is quite common to just not be able to use keybindings either. I feel like there is an issue with not polling input on Wayland, because if I hit CTRL + S once to save something, I can no longer use CTRL + S to save the thing. I have to manually use the save button in the menu.

Steps to reproduce

  1. Use a Wayland compositor. (I am using Hyprland which is a wlroots based compositor.)
  2. Try to change the editor theme in the Editor -> Editor settings... menu.
  3. If done right, the menu is just going to stop working, and eventually the more you use Godot, the more will stop responding to interactions.

Minimal reproduction project (MRP)

Luckily, I don't need to provide a project! Because this is simply an issue with the Godot UI.

@Riteo
Copy link
Contributor

Riteo commented May 6, 2024

Mh, this feels like a window focus issue to me, since the issues you're having are with popups.

Note that, unless you explicitly set it, you're still using the X11 backend through XWayland, a compatibility mechanism, which is known to have some issues unfortunately (#78581).

I'd try forcing single-window mode (Editor -> Editor settings... -> Interface -> Editor -> Single Window Mode) and see whether it improves the situation.

Also, out of curiosity, I'd try the latest pre-release, just in case some fix didn't get backported, although I wouldn't bet on it fixing the issue. Trying doesn't hurt I suppose ;)

@Oglo12
Copy link
Author

Oglo12 commented May 8, 2024

Mh, this feels like a window focus issue to me, since the issues you're having are with popups.

Note that, unless you explicitly set it, you're still using the X11 backend through XWayland, a compatibility mechanism, which is known to have some issues unfortunately (#78581).

I'd try forcing single-window mode (Editor -> Editor settings... -> Interface -> Editor -> Single Window Mode) and see whether it improves the situation.

Also, out of curiosity, I'd try the latest pre-release, just in case some fix didn't get backported, although I wouldn't bet on it fixing the issue. Trying doesn't hurt I suppose ;)

Well, the border of my Wayland compositor does update, and it does focus around the popup properly, and this isn't a popup-only issue. This happens with the main window as well. What happens is the elements I use just stop working after a while. I am guessing it is a polling issue.

@Riteo
Copy link
Contributor

Riteo commented May 9, 2024

and it does focus around the popup properly

That's the thing, my theory is that it might not "unfocus" properly, as there's a lot of fancy input redirection tricks going on. Not sure but I can't do much without further info.

I am guessing it is a polling issue.

It's hard to say as I can't tell from here where the problem is. There's no polling in the X11 backend as far as I'm aware, so it might be stalling. Not sure though as, again, this is not an issue in the Wayland backend, as you're using the X11 compatibility layer.

So, to get rid of any doubts, could you please try the debugging steps I proposed earlier?

@eobet
Copy link

eobet commented May 16, 2024

I'm rather new to Linux so how do I know if I'm using the X11 compability layer? I'm on a Fedora 39 based distro using vanilla Gnome Wayland.

Attempting to use the color picker for me makes makes Godot unresponsive. Attempting to grab a screenshot, or actually even force quitting the process using Mission Control makes my Linux desktop more or less unusable (I can move my mouse cursor, but not much else) so I have to force a reboot.

@Riteo
Copy link
Contributor

Riteo commented May 16, 2024

@eobet for the moment the X11 compatibility layer is the default option, so by all chance, if you didn't change any settings, you are using it :)

That said, the most obvious telltale sign, always assuming default settings, is that all windows are managed by the OS (which use GNOME decorations), as the Wayland backend is currently single-window only due to some limitations in Godot's API that will be fixed once I have enough time (currently busy with a big school exam coming soon)

Another sign should be the fact that, at the moment, there's no godot window icon on the Wayland backend, as it requires a more complex setup (which will hopefully be fixed by a new Wayland addition).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants