feat: display scale for HiDPI screens (ui.scale / --scale) #21
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
BlackLobster/Client!21
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ui-scale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The client draws a fixed 765x503 window. Where the desktop hands old
applications the raw panel resolution and expects them to scale
themselves -- KDE Plasma 6's "legacy applications: apply scaling
themselves", written as [Xwayland] Scale in kwinrc -- Java finds no
Xft.dpi, reports 96 dpi and draws that window at 1:1. On a HiDPI or
scaled ultrawide panel it comes up postage-stamp sized and reads as a
broken client rather than as a display setting.
Sets sun.java2d.uiScale, from ui.scale in config/server.properties
(applied in main() before the first Frame, so it covers double-clicking
the jar and run.bat too) or from run.sh's --scale / $BL_UI_SCALE. With
none of those set, run.sh probes Plasma's own setting and then GDK_SCALE
on Linux, so the machine that has the problem needs no configuration;
macOS is skipped, as AWT handles Retina unaided.
The client blits a fixed-resolution raster, so this is an upscale:
correct physical size, slightly softer pixels.
run-client.sh becomes a wrapper around run.sh -- one launch path rather
than two that drift -- and run.sh honours $JAVA, which it had.