Skip to content

Scale the native window with the Hyprland monitor factor - #65

Draft
NT7S wants to merge 1 commit into
i2cjak:mainfrom
NT7S:backplane/monitor-ui-scale
Draft

NT7S wants to merge 1 commit into
i2cjak:mainfrom
NT7S:backplane/monitor-ui-scale

Conversation

@NT7S

@NT7S NT7S commented Oct 12, 2026

Copy link
Copy Markdown

The native window is an X11 client with a fixed pixel layout. On Hyprland with xwayland.force_zero_scaling, the compositor does not scale that window, so 14 px text stays 14 physical pixels and is hard to read on a scaled monitor.

The layout and pointer events stay in logical pixels. The X window and its framebuffer are that size times the monitor scale. BACKPLANE_UI_SCALE overrides the factor. When it is unset, the focused monitor's scale: from hyprctl monitors is used. A value near 1, or no Hyprland, keeps the old 1:1 path, including the 64 px dirty blocks. Any other scale (0.5 to 4) resamples the frame bilinearly in linear light, so a fractional factor does not stair-step glyphs. BACKPLANE_SNAP still writes the logical frame.

The web client and the phone apps are unchanged. They already follow CSS and device pixels. This is only the X11 framebuffer.

Checked on a Hyprland session at scale 1.6: the process logged UI scale 1.6 (window 2240x1440 for a 1400x900 layout), and a glyph edge blended through intermediate grays. That build was this win.c on the v0.11.1 tree; win.c at that tag is the same as current main before this change. Bend sources are untouched, so bend PROOF.bend was not re-run.

Hyprland's xwayland.force_zero_scaling leaves an X11 window in physical
pixels, so a fixed layout draws tiny text on a scaled monitor. The app
still lays out in logical pixels. The X framebuffer is that size times
the focused monitor's scale (BACKPLANE_UI_SCALE overrides; hyprctl
supplies the factor otherwise). A fractional scale is resampled
bilinearly in linear light. Scale 1 keeps the previous path, including
the 64 px dirty blocks.
@NT7S

NT7S commented Oct 12, 2026

Copy link
Copy Markdown
Author

This is my first AI-assisted PR, so if there's a problem fell free to trash it. I needed to be able to read the text on a higher-DPI display and thought I should at least try to give back since I had Grok build me a fix.

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.

1 participant