This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1289714 - find a solution for XWayland games trying to set display resolution
find a solution for XWayland games trying to set display resolution
Status: NEW
Product: Fedora
Classification: Fedora
Component: xorg-x11-server (Show other bugs)
25
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: X/OpenGL Maintenance List
Fedora Extras Quality Assurance
:
: 1286217 (view as bug list)
Depends On:
Blocks: WaylandRelated
  Show dependency treegraph
 
Reported: 2015-12-08 13:59 EST by Kamil Páral
Modified: 2017-07-01 18:21 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kamil Páral 2015-12-08 13:59:28 EST
This is the year or Linux gaming. We now have thousands of games available for Linux thanks to Steam, and Steam machines running SteamOS (Linux) are sold worldwide. All of those games out there are X11-based. Some of them will get updated for Wayland, but most never will. If we want to push Wayland as the default display technology, we need to make sure those games work.

One of the core issues is display resolution. Game developers and players are used to games changing their display resolution (especially 3D games) in order to achieve satisfactory performance. That is no longer possible in Wayland, and there are good reasons for that, and solutions (scaling the ouput). However, we also need a solution for XWayland games, which is the majority.

Under XWayland, there seems to be only a single resolution available when querying display through xrandr - the current resolution - and no custom resolution can be set.

According to my short testing, there are several ways how games currently cope with that (all of this covers fullscreen behavior only, I haven't seen any issues when running in a windowed mode):

A) Run in a letterbox fixed to a single resolution - the game in enclosed in black bars around the screen (corresponding to the game's default resolution), no change can be made
Examples: OpenArena

B) Run in a letterbox, but allow different resolutions to be set, adjusting letterbox - different resolutions change the rendering size and the size of the black bars around it
Examples: Extreme Tux Racer, Battle for Wesnoth

C) Run in a desktop resolution - you can either see desktop resolution as the only available resolution, or you can see other resolutions available, but nothing happens when you try to set it, you stay fixed to the current one. This is basically the same case as A), only the game default resolution seems to be your desktop resolution. Internal game logic probably differentiates A) and C).
Examples: 0 A.D., Xonotic, Supertuxkart, Neverball

D) Run scaled in a desktop resolution - only single resolution is available, but the game output is scaled as opposed to letterboxing
Examples: Half-Life

E) Use internal scaling instead of relying on system resolutions - this is what some modern games do. Instead of changing the monitor resolution, keep it intact, just adjust the internal rendering resolution and then either scale up the output or display a smaller game area.
Examples: Pillars of Eternity, Gnomoria

F) Crash - when configuring the game in the better case, on startup in the worst case
Examples: Minecraft (according to bug 1287864, not tested)


Only E) is the ideal solution for users of Wayland desktop. A) and B) make the game screen small or tiny, C) and D) don't allow to tune the game performance to available hardware.

There is a simple yet tiresome workaround for B) and C) - switch desktop resolution manually to a desired size, run the game, switch resolution manually back afterwards. I don't know about any workarounds for A), D) and F).


Please try to find a solution for this. If we can't make the crushing majority of games work, Wayland will not convert a large portion of our user base (anyone who sometimes plays a game), they will stay with X11.

For example, could we fake the resolution list for XWayland apps and if they try to set a custom fullscreen resolution, could we tell them it succeeded, but scale their output instead? (similarly to what we intend to do with Wayland-based games)
Comment 1 Kamil Páral 2015-12-08 14:01:17 EST
*** Bug 1286217 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Fourdan 2015-12-16 09:09:03 EST
(In reply to Kamil Páral from comment #0)
> F) Crash - when configuring the game in the better case, on startup in the
> worst case
> Examples: Minecraft (according to bug 1287864, not tested)

Bug 1287864 is a bug in Minecraft itself, not something we can fix.
Comment 3 Olivier Fourdan 2016-04-07 03:52:55 EDT
(In reply to Olivier Fourdan from comment #2)
> Bug 1287864 is a bug in Minecraft itself, not something we can fix.

Actually, a workarround for this was just added to Xwayland, included in xserver 1.18.3 so Minecraft should start in Wayland now (upstream).
Comment 4 Kamil Páral 2016-09-12 09:35:15 EDT
This is still an issue in F25 (e.g. with openarena I can't change its resolution at all).
Comment 5 Olivier Fourdan 2016-09-12 10:41:14 EDT
Well, for games using Xwayland this feature was denied:

https://fedoraproject.org/wiki/Wayland_features#XRandR_control_of_Wayland_outputs
Comment 6 Sean Young 2016-09-12 16:50:47 EDT
That comment said it should be implemented in mutter, not Xwayland.
Comment 7 Kamil Páral 2016-09-13 07:07:42 EDT
(In reply to Olivier Fourdan from comment #5)
> Well, for games using Xwayland this feature was denied:

Yes, and I understand why. However, the purpose of this ticket was whether we can find a different solution to this (because X11-based games will be with us for a long time still). For example:

(In reply to Kamil Páral from comment #0)
> For example, could we fake the resolution list for XWayland apps and if they
> try to set a custom fullscreen resolution, could we tell them it succeeded,
> but scale their output instead? (similarly to what we intend to do with
> Wayland-based games)

Is that doable (or something similar)? Is there a will and time to implement it?

Note You need to log in before you can comment on or make changes to this bug.