Opened 7 years ago

Last modified 5 years ago

#13087 assigned enhancement

Global UI scaling - HiDPI

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Servers/app_server Version: R1/Development
Keywords: hidpi 4k dpi Cc:
Blocked By: Blocking: #10157, #14463
Platform: All

Description

The Haiku interface doesn't scale to higher DPI monitors like a lot of other modern operating systems.

MacOS and Gnome implement a "Global UI Scale" setting which scales up all parts of the UI. Since we rely on vector icons and other point based things, this should be a simple to moderate app_server change.

Pulkomandy outlined a few of the finer points here:

" Anyway for implementing this:

  • We aleady have settings for font size, and Tracker icon sizes. Font sizes are in "points" for which there is not really a precise definition, so we can consider it an arbitrary unit. Tracker icon sizes are currently in pixels, and if there is extra scaling it would not actually be pixels anymore. Maybe we could rename the settings to "small, medium, large, huge" or similar.
  • For the actual implementation: the drawing API has a SetScale and a SetTransform, both of which can be used to change the drawing size of everything. The idea would be to do this automatically when a view is created, and set a global scale (so, it's a little more work than adding a slider to the Appearance prefs).
  • After doing this, expect to discover bugs because of interactions with other drawing primitives: saving to BPicture, applying more transforms, or using Clipping are likely to miss something and result in broken drawing.

An alternative to this approach (global scaling, similar to what macOS does), is to instead change just the font size (in Appearance prefs) and then make sure all apps properly scale their whole UI according to that. So if there is a large font, apps would also use larger icons, etc. This requires more work (as each app needs to be tweaked), but it is possibly simpler (no need to mess with the app_server drawing, transforms and clipping and stuff). " -- https://discuss.haiku-os.org/t/new-desktop-machine-4k-monitor/4411/4

Attachments (2)

macos-scale.png (407.9 KB ) - added by kallisti5 7 years ago.
MacOS scaling - icons
gnome-scale.png (66.6 KB ) - added by kallisti5 7 years ago.
Gnome scaling - slider

Download all attachments as: .zip

Change History (8)

by kallisti5, 7 years ago

Attachment: macos-scale.png added

MacOS scaling - icons

by kallisti5, 7 years ago

Attachment: gnome-scale.png added

Gnome scaling - slider

comment:1 by kallisti5, 7 years ago

I personally like the slider in Gnome more, it feels more customizable. I find myself "tweaking" the scale a lot on my HighDPI laptop.

comment:2 by diver, 7 years ago

Blocking: 10157 added

(In #10157) It appears that blurry fonts were due to the lack of HiDPI support in VirtualBox. It doesn't expose native resolution. Today I managed to boot Haiku natively on my MacBook Pro (with a lot of help help from jessicah) and after changing font size to 20(!) it's quite usable. Not all GUI parts scale though. I'll close it s a dupe of #13087.

comment:3 by axeld, 7 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:4 by waddlesplash, 6 years ago

Blocking: 14463 added

comment:5 by tidux, 5 years ago

A word of caution: however this is handled, make sure all the toolkit ports are updated/patched accordingly: SDL, Qt, OpenJDK, etc. Doing this right, once, will avoid the scaling fragmentation hell that is currently Linux on HiDPI (mostly driven by Qt and legacy X11-only applications).

comment:6 by pulkomandy, 5 years ago

Using native APIs will avoid that. Fragmentation happens when one allows multiple toolkits to coexist, and there isn't much to be done about that.

SDL1 is a dead cause for this (it is very pixel oriented and unmaintained). SDL2 is OpenGL based and its up to applications to do the right thing (we won't lie to them about display resolution). Qt and OpenJDK, I don't know, but its up to the people porting/maintaining them to adjust.

Anyways, it seems that currently we are going with the second solution, namely "adjust font size and everything will scale accordingly".

Note: See TracTickets for help on using tickets.