Repository navigation
Conversation
Currently the Xwayland coordinate space is scaled by the ceiling of the
highest monitor scale. On a 1920x1080 monitor at 125% this results in a
3072x1728 Xwayland root window, so X11 clients are rendered at a higher
resolution than the monitor and then downscaled by the compositor.
Add an xwayland-scaling-mode enum to the org.cinnamon.muffin.wayland
schema:
- automatic (default) keeps the current behavior, i.e. the ceiling of
the highest monitor scale.
- native uses the highest monitor scale directly, so the Xwayland
coordinate space matches the physical monitor resolution (1920x1080
at 125%). This avoids rendering more pixels than necessary, at the
cost of X11 user interfaces appearing smaller on fractional scales.
The setting takes effect immediately by reapplying the monitor
configuration, which updates the output geometry and the scale used for
existing Xwayland surfaces.
The scale used by Xwayland is now a double throughout the surface,
shaped texture and window actor paths, since fractional scales such as
1.25 or 1.5 are no longer rounded up.
Based on the approach discussed in
https://gitlab.gnome.org/GNOME/mutter/-/issues/3767.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a 1920x1080 monitor at 125%, Xwayland currently gets a 3072x1728 X screen
(
ceil(highest monitor scale) == 2). X11 clients therefore render at a higherresolution than the monitor and the compositor downscales them. This wastes GPU
time and can cause input lag (mutter#3767).
This adds an
xwayland-scaling-modeGSettings enum toorg.cinnamon.muffin.wayland:automatic(default): keep the current behavior, i.e. scale the Xwaylandcoordinate space by
ceil(highest monitor scale).native: use the highest monitor scale directly, so the Xwayland coordinatespace matches the physical monitor resolution (1920x1080 at 125%). This
avoids rendering more pixels than necessary, at the cost of X11 user
interfaces appearing smaller on fractional scales.
Changing the setting takes effect immediately by re-applying the monitor
configuration, which updates the output geometry and the scale used for
existing Xwayland surfaces. The
MUFFIN_DEBUG_DISABLE_XWAYLAND_SCALINGescape hatch is preserved.
Internally the Xwayland effective scale is now a
double, and the surface,shaped texture, window actor, input and DnD paths were converted from integer
scale handling to fractional scales with explicit rounding.
Based on the approach discussed in
https://gitlab.gnome.org/GNOME/mutter/-/issues/3767.
Testing
ninjabuilds successfully with and without tests, andglib-compile-schemas --strictaccepts the updated schema.gsettings range org.cinnamon.muffin.wayland xwayland-scaling-modereportsautomatic/native, and the default isautomatic.GSETTINGS_SCHEMA_DIR=<build>/data(as the Debianpackaging already does) so it picks up the new key. With that, the suite
reaches the pre-existing
/backends/monitor/one-disconnected-linear-configfailure, which also fails on unmodified
master.No automated test was added for the new key: mutter's Xwayland scaling test
relies on
MonitorTestCaseSetup/meta_create_monitor_test_setup, which arelocal static helpers in Muffin's
monitor-unit-tests.c, and Muffin has noequivalent Xwayland test harness yet. Happy to add one in a follow-up if
preferred.
Manual verification