Skip to content

hyprland 0.57.2-13: xwayland:scale for sharp X11 apps - #1757

Open
ParkerrDev wants to merge 16 commits into
omacom:masterfrom
ParkerrDev:hyprland-xwayland-scale
Open

ParkerrDev wants to merge 16 commits into
omacom:masterfrom
ParkerrDev:hyprland-xwayland-scale

Conversation

@ParkerrDev

@ParkerrDev ParkerrDev commented Oct 28, 2026 •

Copy link
Copy Markdown

X11 apps currently change apparent size between monitors with different scales. This adds xwayland:scale to 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.

0 preserves existing behavior, -1 uses the ceiling of the highest monitor scale, -2 uses that scale exactly, and a positive number selects it explicitly. xwayland_unscaled keeps 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 = false disables 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:

  • Verified the archive checksum, applied all four patches with --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.
  • Ran the built compositor nested with stock Xwayland and monitors at 1.6 and 1. An 800x600 X11 buffer stays 400x300 logical pixels when moved between them. Pointer motion to 300,250 logical pixels reaches 600,500 in X11.
  • Toggled xwayland_unscaled on 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.
  • Earlier plugin validation on patched 0.57.1: built and loaded the external Vetro glass plugin, verified glass and window animations visually, and exercised plugin unload/reload. That plugin check has not been repeated on 0.57.2 and does not validate the titlebars plugin.

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_scaling now invalidates the cached X11 scale, just like changing xwayland: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.sh compiles 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 in run-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_64 builds the package in the repository's builder container, the built Hyprland carries xwayland:scale, and tests/hyprland-xwayland-reload.sh passes. 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.patch and added tests/recipe-hygiene.py to 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, and tests/hyprland-xwayland-reload.sh, tests/recipe-hygiene.py, tests/pinned-sources.sh and tests/package-metadata.sh pass. The same patch over the same 0.57.2-12 recipe is built daily by xscale's packages workflow (release hyprland-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: a bin/build container build of this exact head, the gtest suite, and aarch64.

…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.
ParkerrDev added a commit to ParkerrDev/xscale that referenced this pull request Oct 28, 2026
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.
@ParkerrDev
ParkerrDev marked this pull request as ready for review October 28, 2026 15:23
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] No actionable blocking issue was found; the PR appears safe to merge.

Summary

Adds a carried Hyprland patch for one X11 drawing scale across monitors.

  • X11 apps use one render scale across all monitors.
  • Selected X11 apps and their menus keep their intended size.
  • X11 scale changes take effect on config reload.

This review did not repeat the full compositor build or graphical checks.

Diagram

%%{init: {'theme': 'neutral', 'htmlLabels': false}}%%
flowchart LR
  A["X11 scale settings"] --> B["Arrange monitors"]
  B --> C["Save each monitor's X11 scale"]
  C --> D["Convert window sizes and positions"]
  C --> E["Publish X11 output sizes"]
  D --> F["Draw windows and place the pointer"]
Loading

Reviews (14) · Last reviewed commit: "Merge master and carry X11 scaling on hy..." · Reviewed by Greptile

Comment thread pkgbuilds/hyprland/xwayland-scale.patch Resolved
Comment thread pkgbuilds/hyprland/xwayland-scale.patch Resolved
ParkerrDev added a commit to ParkerrDev/xscale that referenced this pull request Oct 28, 2026
…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.
@ParkerrDev

Copy link
Copy Markdown
Author

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 (CX11Backend), so most of the change lives there now.

It applies with --fuzz=0 to the v0.57.0 tag, alone or after monitor-rule-vrr.patch. The other three patches in the recipe don't apply to 0.57.0 as they are, so it hasn't been tried after their rebases. Its 834 unit tests pass, and in a nested Hyprland with stock Xwayland it gives the same results as the patch here: X11 sizes with Omarchy's monitors.lua, filtering unchanged with xwayland:scale at 0, popups and cursors of unscaled windows, and live changes of the scale, the rule and the monitors.

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.
ParkerrDev added a commit to ParkerrDev/xscale that referenced this pull request Oct 28, 2026
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.
ParkerrDev added a commit to ParkerrDev/xscale that referenced this pull request Oct 28, 2026
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.
@yamz8

yamz8 commented Oct 29, 2026 •

Copy link
Copy Markdown

Heads-up on timing: Arch's x86_64 hyprland is now 0.57.0-1, so with [omarchy] ahead of extra this would keep x86_64 edge on 0.56.2-8 rather than step ahead of Arch.

That runs against the titlebars fix in flight. omarchy-pkgs#1788 pins x86_64 omarchy-hyprland-titlebars to hyprland=0.57.0, and its source port (omacom/omarchy-hyprland-titlebars#7) no longer builds against 0.56. Since sync-rebuilds reads a trigger this repo carries from the recipe, landing this would move titlebars back to 0.56.2, while #1788 and omacom/omarchy-hyprland-titlebars#7 move it to 0.57.0. Only one of the two can land.

Moving this recipe to 0.57.0 first, with your rebased xwayland-scale-0.57.0.patch, would line the two up. That bump is also what aarch64 needs before titlebars can be tagged for 0.57.

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.
@ParkerrDev ParkerrDev changed the title hyprland 0.56.2-8: xwayland:scale for sharp X11 apps, built for x86_64 too hyprland 0.57.0-3: xwayland:scale for sharp X11 apps Oct 29, 2026
@ParkerrDev

Copy link
Copy Markdown
Author

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: xwayland-scale.patch for 0.57.0, applied after the three rebased patches with every hunk exact under --fuzz=0, and pkgrel 3. It no longer touches arch, rebuilt_against or anything titlebars reads.

New members still go last in their classes, so the plugin's layouts are unchanged and its hyprland=0.57.0 dependency holds at 0.57.0-3. titlebars.so 0.3.0-1 resolves the same against 0.57.0-3 as against 0.57.0-2.

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 wl-output-global-grace.patch has CWLOutputProtocol::remove() add a timer through g_pEventLoopManager, which the unit tests never create. A running Hyprland always has one, and the recipe has no check(), so CI does not see it. The 14 pass with that patch taken out. Details are in the PR body.

Comment thread pkgbuilds/hyprland/xwayland-scale.patch Resolved
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.
@ParkerrDev ParkerrDev changed the title hyprland 0.57.0-3: xwayland:scale for sharp X11 apps hyprland 0.57.1-3: xwayland:scale for sharp X11 apps Nov 11, 2026
@ParkerrDev ParkerrDev changed the title hyprland 0.57.1-3: xwayland:scale for sharp X11 apps hyprland 0.57.2-3: xwayland:scale for sharp X11 apps Nov 11, 2026
Comment thread pkgbuilds/hyprland/xwayland-scale.patch Resolved
@ParkerrDev ParkerrDev changed the title hyprland 0.57.2-3: xwayland:scale for sharp X11 apps hyprland 0.57.2-4: xwayland:scale for sharp X11 apps Nov 15, 2026
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.
@ParkerrDev ParkerrDev changed the title hyprland 0.57.2-4: xwayland:scale for sharp X11 apps hyprland 0.57.2-10: xwayland:scale for sharp X11 apps Nov 27, 2026
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.
@ParkerrDev ParkerrDev changed the title hyprland 0.57.2-10: xwayland:scale for sharp X11 apps hyprland 0.57.2-13: xwayland:scale for sharp X11 apps Dec 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants