godot icon indicating copy to clipboard operation
godot copied to clipboard

Editor ignores 'run/window_placement/screen' setting when 'prefer_wayland' is enabled

Open tarobic opened this issue 1 year ago • 2 comments

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

tarobic avatar Feb 09 '24 18:02 tarobic

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.

deralmas avatar Feb 10 '24 01:02 deralmas

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.

tarobic avatar Apr 30 '24 16:04 tarobic

@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.

deralmas avatar May 03 '24 07:05 deralmas

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.

tarobic avatar May 03 '24 16:05 tarobic

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.

deralmas avatar May 03 '24 21:05 deralmas

Right the game launches with Xwayland but the editor itself keeps using Wayland.

tarobic avatar May 03 '24 22:05 tarobic

@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.

deralmas avatar May 04 '24 02:05 deralmas

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. :)

4X3L82 avatar Jul 18 '24 11:07 4X3L82