Toggle compositor scale for XWayland activities #46

Merged
albert merged 2 commits from u/albert/45/xwayland-dpi into main 2026-05-18 01:23:05 +00:00
Owner

Sway does not pass output scaling to XWayland clients, so XWayland games
on a HiDPI panel render at logical resolution and get upscaled (issue
#45). Add an opt-in xwayland_native_resolution entry flag that drops
sway's output scale to 1.0 for the duration of the activity and restores
it on exit. The HUD compensates with a counter-scale broadcast via a new
HudScaleChanged event so it stays at its usual physical size.

Fixes #45

Sway does not pass output scaling to XWayland clients, so XWayland games on a HiDPI panel render at logical resolution and get upscaled (issue #45). Add an opt-in `xwayland_native_resolution` entry flag that drops sway's output scale to 1.0 for the duration of the activity and restores it on exit. The HUD compensates with a counter-scale broadcast via a new `HudScaleChanged` event so it stays at its usual physical size. Fixes #45
Toggle compositor scale for XWayland activities
All checks were successful
CI / Test (pull_request) Successful in 9m50s
CI / Clippy (pull_request) Successful in 10m6s
CI / Rustfmt (pull_request) Successful in 10m4s
CI / Build (pull_request) Successful in 10m12s
CI / E2E (pull_request) Successful in 10m9s
CI / ShellCheck (pull_request) Successful in 8s
CI / Android portability (shepherd-media-core) (pull_request) Successful in 3m1s
1314fde648
Sway does not pass output scaling to XWayland clients, so XWayland games
on a HiDPI panel render at logical resolution and get upscaled (issue
#45). Add an opt-in `xwayland_native_resolution` entry flag that drops
sway's output scale to 1.0 for the duration of the activity and restores
it on exit. The HUD compensates with a counter-scale broadcast via a new
`HudScaleChanged` event so it stays at its usual physical size.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Scale HUD icons and volume slider with HUD scale factor
All checks were successful
CI / Test (pull_request) Successful in 8m39s
CI / Rustfmt (pull_request) Successful in 8m51s
CI / Clippy (pull_request) Successful in 8m54s
CI / Build (pull_request) Successful in 9m0s
CI / E2E (pull_request) Successful in 8m56s
CI / ShellCheck (pull_request) Successful in 8s
CI / Android portability (shepherd-media-core) (pull_request) Successful in 2m49s
3eab047b5d
The XWayland HiDPI scaling change in 1314fde left
`gtk4::Image::set_pixel_size(20)` and `Scale::width_request(100)`
unscaled because they are widget properties, not CSS literals reachable
by the per-px stylesheet rewrite. On the kiosk panel at factor 1.5 the
four bar icons and volume slider were visibly undersized.

Move those magic numbers to `BASE_ICON_PIXEL_SIZE` and
`BASE_VOLUME_SLIDER_WIDTH` and extend the scale-change branch of the
500ms timer to update each on factor change. The two icon-name buttons
get explicit child `Image` widgets so their pixel size is reachable;
dynamic icon swaps now go through `Image::set_icon_name(Some(..))` on
the child instead of `Button::set_icon_name(..)`, which would replace
the child entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
albert merged commit 543a9be346 into main 2026-05-18 01:23:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
albert/shepherd-launcher!46
No description provided.