protonscr

Fullscreen Games display on only the Primary Monitor on Multi-Monitor Setup

protonclosed
ValveSoftware/Proton#6938 · opened 2023-07-19 by lunesar · updated 2024-07-26 · 10 comments · github
Llunesar 2023-07-19 github

@alasky17 @zzhiyi

This issue was previously discussed along with issue 6651. I initially posted there because I thought it would be a duplicate issue, but now that issue 6651 has been debugged to be a mutter bug, which wouldn't apply to my setup, it is likely a different but similar bug and needed a new issue to be opened.

The issue I observe is that fullscreen 3D rendered games such Satisfactory, The Planet Crafter, Frostpunk, Dyson Sphere Program, and Deathmatch Classic are forced to be on the primary monitor. I can change the assignment of which monitor is the primary monitor in my display options, and that does change which monitor the games is forced to be on, which is a workaround for this issue, but not a full solution.

The reason why I initially thought it was a duplicate of issue 6651 is because it first appeared with the same 2 commits to wine (f2f5394825854c8b904731fa898ff10a0c1ad6df and 6e333f4d99d16f022a88c4cb91b67176a5e7f8b6) which first appeared in Proton 7.0-6.

When using Proton 7.0-5 and builds prepared by @alasky17 that reverted those 2 commits this behavior was not seen and I could use Meta/Super/Win+Shift+left/right to freely change which monitor the display is on. When using Proton 7.0-6 or Proton 8.0 releases I see the behavior where the display is always on the primary monitor. Unlike issue 6651 it does not matter which port on my video card the monitor is plugged into, it only matters which monitor has been assigned as the primary monitor.

Here's my setup infomation:

==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.204
System:
  Kernel: 5.19.0-43-generic x86_64 bits: 64
    Desktop: Cinnamon 5.4.12 Distro: Linux Mint 21 Vanessa
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A
  Mobo: ASUSTeK model: ROG CROSSHAIR VIII HERO (WI-FI) v: Rev X.0x
    UEFI: American Megatrends v: 4201
    date: 04/26/2022
CPU:
  AMD Ryzen 7 5800X3D
Graphics:
  Device-1: AMD Navi 23 [Radeon RX 6600/6600 XT/6600M] driver: amdgpu
    v: kernel
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,radeon,vesa gpu: amdgpu resolution:
    1: 1920x1080~60Hz 2: 1920x1080~60Hz 3: 1920x1080~60Hz
  OpenGL:
    renderer: AMD Radeon RX 6600 (navi23 LLVM 15.0.6 DRM 3.47 5.19.0-43-generic)
    v: 4.6 Mesa 22.2.5
Zzzhiyi 2023-07-20 github

So the problem is that you can't change the monitor using Meta/Super/Win+Shift+left/right since f2f5394? Did you check on Windows?

Zzzhiyi 2023-08-14 github

0001-winex11.drv-Set-_NET_WM_FULLSCREEN_MONITORS-only-when-.txt
should fix this. I tested it on GNOME and Cinnamon DE. Actually, GNOME should be able to reproduce this and I've used it because Cinnamon DE in fact uses an older version of Mutter.

Mutter log:

Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: handle_move_to_monitor line 2862
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: handle_move_to_monitor line 2867
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_move_to_monitor line 4173
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_move_between_rects line 4084
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_move_resize_internal line 3888 constrained_rect 3840,32 3840x2160 
!!position changed!! --> Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_move_resize_internal line 3904 constrained_rect 0,0 3840x2160
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_move_resize_internal line 3924 constrained_rect 0,0 3840x2160 
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1325
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1335
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1369 constrained_rect 0,0 3840x2160 client_rect 0,0 3840x2160
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1418
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1435 need_move_client 0 need_move_frame 0 need_resize_client 0 need_resize_frame 0
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1461
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1524
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1549
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: meta_window_x11_move_resize_internal line 1560 need_configure_notify 0
Aug 14 12:12:47 eric-pc gnome-shell[1168247]: SCREEN_CAST: line 4183 meta_window_move_to_monitor done! new_area 3840 0 3840 2160

Setting _NET_WM_FULLSCREEN_MONITORS adds a fullscreen constraint on Mutter so that such a window can't be moved to another monitor by using the Shift+Super+Up/Down/Left/Right shortcut. If _NET_WM_FULLSCREEN_MONITORS is set then the property needs to be updated because it can't be deleted by sending a _NET_WM_FULLSCREEN_MONITORS client message to the root window according to the wm-spec version 1.4. Having the window spanning more than two monitors also needs the property set. In other cases, _NET_WM_FULLSCREEN_MONITORS doesn't need to be set. So the property should be added only when necessary.

I also thought about fixing Mutter as well. For example, removing META_MOVE_RESIZE_CONSTRAIN from the meta_window_move_resize_internal() call in meta_window_move_between_rects workaround it. But this falls in the behaviors not defined by any specs so the WM in theory can do what they want. I created https://gitlab.gnome.org/GNOME/mutter/-/issues/2967 for Mutter to discuss whether the behavior should be changed.

Llunesar 2023-08-14 github

Thank you for debugging this and taking the actions necessary to resolve it, I greatly appreciate it!

IIhnivid 2023-09-12 github

0001-winex11.drv-Set-_NET_WM_FULLSCREEN_MONITORS-only-when-.txt should fix this. I tested it on GNOME and Cinnamon DE. Actually, GNOME should be able to reproduce this and I've used it because Cinnamon DE in fact uses an older version of Mutter.

Hello, I'm having the same issue as OP, but overwhelmed with applying your fix found in the textfile.

If I understand it correctly you've added some lines to the file dlls/winex11.drv/window.c, but I don't know where to look for that file on my system. Is it somewhere in my wine install, or somewhere in steam/proton folders? Can I even do this with my versions of Proton, which are just installed by steam?

Or is it a fix which will (might) be part of a future release?

Aalasky17 2023-09-12 github

@Ihnivid This change is in a particularly tricky and sensitive area of Wine, so it could take some time for it to be in a regular release. We are working on it :)

In the meantime, you would have to build Proton from scratch in order to utilize the fix. I happen to have a build that we are using for testing purposes. I uploaded it here: https://www.codeweavers.com/xfer/alasky/multi-monitor-fix/ with lock code: "mutter". To use this build:

  1. Create a compatibilitytools.d folder with this path if you do not already have one:
    ~/.steam/steam/compatibilitytools.d
  2. Drop this tarball into compatibilitytools.d
  3. Untar ball
  4. Restart Steam
    This Proton build will show up as an option from the dropdown menu for selecting various Proton versions.
IIhnivid 2023-09-14 github

@alasky17 Thanks a lot, this has really been getting on my nerves.

Llunesar 2024-06-20 github

Did this get fixed? I had been using the build provided by @alasky17 in issue 6651 for quite some time to work around this issue, but decided to try Proton 9.0-2. At least with the game I tested it out on I was able to switch monitors with no issue. Did this get fixed with Proton 9?

Zzzhiyi 2024-06-20 github

Did this get fixed? I had been using the build provided by @alasky17 in issue 6651 for quite some time to work around this issue, but decided to try Proton 9.0-2. At least with the game I tested it out on I was able to switch monitors with no issue. Did this get fixed with Proton 9?

Yes. It is upstreamed by https://source.winehq.org/git/wine.git/commitdiff/70c9239cb2eef696eea109f3f8e7a58f80cd3823

Aalasky17 2024-06-20 github

Whoops! I'm sorry I forgot to update here when this got fixed. Thank you for following up :)

Kkisak-valve maintainer 2024-07-26 github

Closing per the last couple comments.

Proton versions

Upstream links