Repository navigation
hyprland 0.57.2-13: xwayland:scale for sharp X11 apps - #1757
ParkerrDev wants to merge 16 commits into
Conversation
…4 too xwayland-scale.patch, from ParkerrDev/xscale, adds xwayland:scale: one scale every X11 client renders at, so X11 apps are sharp and the size of their Wayland selves on every monitor. 0, the default, changes nothing. The recipe builds for x86_64 as well, so PCs get this Hyprland, with all of its patches, in place of Arch's. rebuilt_against records the aquamarine the x86_64 build used.
…ange xwayland-scale.patch now leaves out the xwayland_shell_v1 version 2 part. Hyprland lays the X11 screen out at xwayland:scale and scales each X11 window down to its logical size itself, as it already did for Arch's xorg-xwayland, so the patch needs nothing of Xwayland and vendors no protocol. It is 22 files instead of 36. A config reload that changes only xwayland:scale now lays the monitors out again, as a monitor change does, instead of waiting for the next one.
With xwayland:scale, an X11 cursor is drawn in X11 pixels and was shown at that size: twice Hyprland's own at a scale of 2. Hyprland now shows it as it shows the X11 window under it, divided by that window's X11 scale, and at its own size over a window under xwayland_unscaled. A cursor surface's viewport now sets its size, so with xscale's Xwayland, which sizes its cursors with one, the cursor is right as well; before, it came out twice as large there too. Without xwayland:scale nothing changes. upstream/omarchy/ holds the patch proposed for Omarchy's own Hyprland in omacom/omarchy-pkgs#1757: this one without the xwayland_shell_v1 version 2 part, so Hyprland does all of the scaling and Arch's Xwayland is enough.
With xwayland:scale, an X11 cursor is drawn in X11 pixels and was shown at that size: twice Hyprland's own at a scale of 2, as it already is today under force_zero_scaling. Hyprland now shows it as it shows the X11 window under it, divided by that window's X11 scale, so a toolkit that draws its cursor at the X11 scale gets one the size of Hyprland's. Without xwayland:scale nothing changes.
Confidence Score: 5/5
[Medium impact] No actionable blocking issue was found; the PR appears safe to merge. SummaryAdds a carried Hyprland patch for one X11 drawing scale across monitors.
This review did not repeat the full compositor build or graphical checks.
|
…ow the switch With xwayland:scale at 0, an X11 window enlarged by the monitor scale (force_zero_scaling off) is drawn with nearest neighbour again when xwayland:use_nearest_neighbor asks for it; only a window drawn at the X11 scale is filtered linearly. A menu or tooltip of a window under xwayland_unscaled is placed in its owner's pixels only while xwayland:unscaled_windows is on, so turning the switch off restores its position as well as its size. Both found by the review of omacom/omarchy-pkgs#1757.
… the unscaled switch From the review: X11 windows at a fractional monitor scale now get linear filtering only when xwayland:scale is set, so with it at 0 they are filtered exactly as on stock Hyprland. An override-redirect popup is placed by the unscaled rule only while xwayland:unscaled_windows is on, as its parent is.
|
For when the recipe moves to Hyprland 0.57.0, the same patch rebased on it is here. 0.57.0 moved X11 windows into a backend class of their own ( It applies with |
No change in behavior. The comments on the new declarations in Window.hpp and MonitorLayoutController.hpp move to their definitions, so the declarations align with their neighbors, the xwayland_unscaled entry in resetProps goes last so the list keeps its packing, and a brace and three blank lines follow Hyprland's style. git clang-format against the 0.56.2 tree changes nothing. Rebuilt with bin/build for x86_64; Hyprland's 273 unit tests pass.
The same as omacom/omarchy-pkgs#1757 at 4374776c: comments moved to the definitions, the new resetProps entry last, a brace and blank lines in Hyprland's style. No change in behavior.
An X11 cursor was divided by the X11 scale whatever size it was drawn at. GTK and Qt draw theirs at XCURSOR_SIZE times the scale and came out right, but Chromium and Electron apps, Steam and Wine load XCURSOR_SIZE as it is, so at a scale of 2 their cursor came out half the size of Hyprland's. A cursor is now divided by the X11 scale only down to Hyprland's cursor size, and one drawn smaller than that keeps its own size, as without xwayland:scale. The hotspot follows the buffer it belongs to, since Xwayland sets it before it commits that buffer. Without xwayland:scale nothing changes.
Chromium and Electron apps, Steam and Wine draw XCURSOR_SIZE as it is, so dividing their cursor by the X11 scale made it half the size of Hyprland's. An X11 cursor is now divided by the X11 scale only down to Hyprland's cursor size, and its hotspot is set again when Xwayland commits the new buffer. Both patches, 0.56.2 (as in omacom/omarchy-pkgs#1757) and 0.57.0.
|
Heads-up on timing: Arch's x86_64 That runs against the titlebars fix in flight. omarchy-pkgs#1788 pins x86_64 Moving this recipe to 0.57.0 first, with your rebased |
Master now builds 0.57.0 for both architectures (omacom#1802, omacom#1821), so this drops its own arch, pkgrel and rebuilt_against changes and carries only the patch: the 0.57.0 version of xwayland-scale.patch, applied after the three rebased patches, every hunk exact with --fuzz=0, and pkgrel 3 so machines on 0.57.0-2 take it.
|
Thanks for the heads-up. Master moved the recipe and titlebars to 0.57.0 together (#1802, #1821) in the meantime, so I merged master in and this is now only the patch on top of it: New members still go last in their classes, so the plugin's layouts are unchanged and its Something I ran into that is not from this PR: 14 of Hyprland's 834 unit tests (wl_output, xdg_output, output power) segfault on master's 0.57.0-2, because |
Review: a menu or tooltip of an app with both a window under xwayland_unscaled and an ordinary one was taken for the unscaled window's whenever it lay outside both, and also when it lay in the ordinary window, since the fallback was any unscaled window of the same process. It then drew at 1 and landed at the wrong window's place. Its window is now the one it is transient for (through the menus it was opened from), or else the app's window it lies in or is nearest to, and it is unscaled only when that window is.
Master moved the recipe to 0.57.2-9 with four patches of its own (held pointer, monitor zoom, startup hold, startup cursor). xwayland-scale.patch still applies after all of them with --fuzz=0 and the package builds; pkgrel goes to 10, one above master's. The test workflow now runs the self-tests through tests/run-self-tests.py, so the X11 reload test is listed there.
master moved the recipe to 0.57.2-12 with modeless-monitor-blur-refresh.patch. xwayland-scale.patch now applies after it, every hunk exact under --fuzz=0, and pkgrel goes to 13.
X11 apps currently change apparent size between monitors with different scales. This adds
xwayland:scaleto Hyprland 0.57.2-13 so every X11 client draws at one scale and Hyprland displays its buffers at logical size on each monitor. It works with stock Xwayland and changes no protocol.0preserves existing behavior,-1uses the ceiling of the highest monitor scale,-2uses that scale exactly, and a positive number selects it explicitly.xwayland_unscaledkeeps apps that always draw at 1x at their intended size. Their menus inherit the owner's rule, including menus already open when it is toggled;xwayland:unscaled_windows = falsedisables the exception globally. Cursor sizing, pointer coordinates and X11 size hints use the same scale.The patch follows the 0.57 X11 backend split and is applied last, after the package's eight other patches. The recipe now requires hyprutils >=0.14.3 and Aquamarine >=0.16.0: 0.57.1 uses
COutputState::setMaxBpc, absent from Aquamarine 0.15.1 despite the upstream CMake minimum. The current master merge preserves Hyprland 0.57.2 and titlebars 0.4.0-1, including the plugin’s exact Hyprland 0.57.2 dependency. The X11 patch is unchanged; all its hunks apply to the new release with zero fuzz.Validation on x86_64 with the 0.57.2 release source:
--fuzz=0, and built the full compositor, hyprctl and hyprpm using an isolated dependency prefix. Package metadata, pinned-source and shadowed-package checks pass. The build matrix includes x86_64 and aarch64 on edge.xwayland_unscaledon and off with an owned menu already open: parent sizes 400x300 -> 800x600 -> 400x300; menu sizes 100x50 -> 200x100 -> 100x50; menu offsets 20,30 -> 40,60 -> 20,30. The X11 buffer size is preserved. The global off switch also restores scaled window and menu geometry after reload.The fresh 0.57.2 checks do not include aarch64, the full Hyprland unit suite, or a new checkerboard/cursor pixel measurement; the earlier 0.57.0 results remain in PR history. The running desktop remains on the stable distribution package.
The companion configuration change is omacom/omarchy#16935. It sets this scale alongside GDK_SCALE in current defaults and monitor settings. The patch source and maintenance notes are in https://github.com/ParkerrDev/xscale and the package README.
Maintenance validation before the reload fix (2026-11-15, b44e1a9): merged current master without conflicts. The Hyprland recipe and all four patch files are unchanged from the previously validated head; titlebars now follows upstream 0.4.0-1. Package metadata and pinned-source tests pass. The scoped shadowed-package check passes against local repository databases. This maintenance pass does not repeat the compositor build or validate titlebars 0.4.0 at runtime. GitHub package builds still require maintainer approval; these local checks do not replace the x86_64 and aarch64 builds.
Reload fix: changing only
xwayland:force_zero_scalingnow invalidates the cached X11 scale, just like changingxwayland:scale. The arrangement records both values, so repeated reloads without a change do not trigger unnecessary layout work. The recipe is bumped to 0.57.2-4 and its patch checksum updated.Validation of the reload fix: all four patches apply to the checksum-verified 0.57.2 source with
--fuzz=0.tests/hyprland-xwayland-reload.shcompiles the actual predicate and cache assignments from the carried patch with isolated configuration storage; it covers both force-zero toggle directions, cache refresh, unchanged values, and explicit/automatic scales. It fails against b44e1a9 and passes with the fix, and is included in CI. This focused test does not exercise the full compositor reload or graphical output. A fresh full build and nested graphical verification of this fix remain outstanding; GitHub builds require maintainer approval.Master merge for 0.57.2-9 (2026-11-27, a2d936d): master added four patches (held pointer without keyboard focus, monitor-added zoom, startup hold, startup cursor) and moved the test workflow to
tests/run-self-tests.py. The X11 patch is unchanged and goes on after all seven with--fuzz=0; pkgrel is 10, one above master's, and the reload test is listed inrun-self-tests.py. Validation: all eight patches apply to the checksum-verified 0.57.2 source with zero fuzz,bin/build --mirror edge --package hyprland --arch x86_64builds the package in the repository's builder container, the builtHyprlandcarriesxwayland:scale, andtests/hyprland-xwayland-reload.shpasses. Not repeated in this pass: the gtest suite and a nested graphical run on 0.57.2-10.Master merge for 0.57.2-13 (2026-12-05, eb482a2): master moved the recipe to 0.57.2-12 with
modeless-monitor-blur-refresh.patchand addedtests/recipe-hygiene.pyto the runner. The X11 patch is unchanged and goes on after all eight with--fuzz=0. pkgrel is 13, one above master's, and the runner lists both the reload test and recipe hygiene. Validation: all nine patches apply to the 0.57.2 release source with zero fuzz, andtests/hyprland-xwayland-reload.sh,tests/recipe-hygiene.py,tests/pinned-sources.shandtests/package-metadata.shpass. The same patch over the same 0.57.2-12 recipe is built daily by xscale's packages workflow (releasehyprland-omarchy-0.57.2-12.8) and runs as the desktop compositor on an x86_64 Omarchy 4.6 machine with monitors at 1.6 and 1. Not repeated in this pass: abin/buildcontainer build of this exact head, the gtest suite, and aarch64.