Editor ignores 'run/window_placement/screen' setting when 'prefer_wayland' is enabled
Tested versions
Reproducible in 4.3 dev 3
System information
Godot v4.3.dev3 - Arch Linux #1 SMP PREEMPT_DYNAMIC Mon, 05 Feb 2024 22:07:49 +0000 - Wayland - GLES3 (Compatibility) - AMD Radeon RX 6600 (radeonsi, navi23, LLVM 16.0.6, DRM 3.57, 6.7.4-arch1-1) () - AMD Ryzen 7 5700G with Radeon Graphics (16 Threads)
Issue description
Godot always runs the project on screen 1 instead of screen 2 regardless of window placement setting. If the editor is on screen 2, the project still always launches on screen 1.
Steps to reproduce
- Create new project
- Create empty node as scene root
- Change window placement setting to 'next screen' or 'screen 2'
- Run project
Minimal reproduction project (MRP)
N/A
Wayland has no API for asking to be put on a screen AFAIK.
At most, we could change the output onto which we fullscreen, through xdg_toplevel::set_fullscreen, but that's it unfortunately.
I just figured out a workaround for this. Change the window_placement/rect setting to 'custom position' then match the x value to the size of your main monitor e.g. 1920 for a 1080p monitor. Use -1920 if you want the window to show up on the next screen to the left. It only works if the project settings display driver is set to default or x11 unfortunately.
@mattsullentrup to be clear, as far as I'm aware, this behavior is not present in any (commonly-implemented) protocol specification and thus is non-compliant and compositor-specific.
In other words, It might work on e.g. mutter but not kwin and so on.
Gotcha well that method at least works for me with kwin. I just like being able to tweak stuff in the editor with the game up on my other screen.
It only works if the project settings display driver is set to default or x11 unfortunately.
Oh wait I just noticed this sentence. You're using XWayland then, so it's not actually using Wayland. That makes a lot more sense now.
In other words, yeah, it should still work fine with XWayland AFAIK.
Right the game launches with Xwayland but the editor itself keeps using Wayland.
@mattsullentrup exactly, that's why we put two settings actually. The Wayland backend is definitely enough for the editor (sans multiple windows for now) but not necessarily for games, so people might want to switch them indipendently.
I found this ticket because I was experiencing the same issue: Wayland ignoring the Same as Editor screen selection.
However, I found an option that does work for me: Primary screen.
Maybe this can help you/someone. :)