feat: a per-container Upscaling Resolution for the gamescope output size
Description
Gamescope was always launched with -W/-H set to the panel's real pixel size, so the size a game upscales to was not something a container could choose. A new Upscaling Resolution dropdown in the Graphics tab, directly below Display Server, stores that choice per container. New feature, so it falls under "Other" in the template below.
What -W/-H and -w/-h mean here. In gamescope, -W/-H are the output (scanout) size — what gamescope presents at, and therefore the size the game is upscaled to — while -w/-h are the game's internal resolution. The launch command keeps -w/-h at the container screen size (General tab) and now takes -W/-H from the new setting, so the pair reads "render at -w/-h, upscale to -W/-H".
The three kinds of value.
- Disabled —
-W/-Hfollow the container screen size, so-W/-Hand-w/-hare the same pair and nothing is resampled. - Device's Resolution —
-W/-Hfollow the panel's real pixel size (the behaviour before this change). - Every General-tab resolution, listed in descending order, default
1920x1080.
GNDRM_SCANOUT, which seeds the shim's scanout geometry, is read from the same resolved resolution, so it cannot drift from the launch command's -W/-H.
Storage. The choice is a container extra (gamescopeOutputResolution), written and read next to the existing sharpness/ReShade extras, so there is no schema change and an untouched container keeps the 1080p default.
UI. The row is shown only on the gamescope display server, hidden on X11 where it would do nothing — the same treatment as the HDR switch below it. Disabled reuses the existing disabled string; the title and the Device's Resolution label are new and translated in all 15 locales.
Verification. :app:compileLegacyDebugKotlin :app:compileLegacyDebugJavaWithJavac builds with mergeLegacyDebugResources, no warnings.
Known limits. The default is 1080p, so on a panel larger than 1080p an existing container now launches -W 1920 -H 1080 instead of the panel size until the user picks another value — Device's Resolution restores the old behaviour. On a panel with no connector mode at the chosen size, gamescope falls back to the panel's first mode and the presenter does the scaling, which is the case most likely to need device measurement. Not yet run on a device.
Recording
Type of Change
- Bug fix
- Performance / stability improvement
- Compatibility improvements
- Other (requires prior approval)
Checklist
- If I have access to
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed. - This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
- I have attached a recording of the change.
- I have read and agree to the contribution guidelines in
CONTRIBUTING.md.
Summary by cubic
Adds a per-container Upscaling Resolution setting that controls the gamescope output size (-W/-H), which was previously always the panel's real pixel size. Containers can now present at Disabled (container screen size), Device's Resolution (panel size, the old behavior), or any General-tab resolution, with 1920x1080 as the default.
- The stored setting is a container extra alongside sharpness/ReShade, so no schema change;
GNDRM_SCANOUTreads the same resolved resolution so it can't drift from-W/-H. - The nested geometry (
-w/-h) is exported asGNDRM_SCANOUT_NESTED, so Xwayland's early window-sized allocations resolve immediately instead of staying kernel-owned and being copied in. - The dropdown appears only on the gamescope display server; the default means existing containers on panels larger than 1080p now launch at 1080p until another value is selected.
- Launches carrying an intent override no longer fall back to the default: the merged config keeps the container's choice, since the intent schema can't set it.
Summary by CodeRabbit
- New Features
- Added a Gamescope output-resolution setting for non-X11 displays. Choose disabled scaling, the device’s native resolution, or an available resolution from the General settings.
- The setting defaults to 1920×1080, is saved with container settings, and is applied when launching games.
- Added translations for the new setting and device-resolution option across supported languages.