Web lists-archives.com

Non-integral scaling factors: best practices?

GTK+3 added native support for user interface scaling to support HiDPI displays with consistently sized resources and widgets, with the limitation that the scaling factor is an integer (1x, 2x, 3x...)

This seemed a good bet when the earliest HiDPI iOS, MacOS and ChromeOS machines all came out at 2x, and holds for many high-end PCs... However, PC laptops with 1920x1080 screens that need a 1.5x or so scaling factor are now quite common, and a lot of people have CC'd themselves on this old bug asking about it: https://bugzilla.gnome.org/show_bug.cgi?id=720502

This also means non-integral scaling factors are common on Windows, which may affect cross-platform apps using a GTK+ front-end.

Is there anything that could be done in the GTK+ 4 dev cycle to better support non-integral scaling factors? I don't know if it's either feasible or desirable to just rip out the integers and replace with floats...

Alternately, would it make sense to recommend best practices for applications to make display sizes of non-text elements scale along with the font scaling factor?

For instance, there might be a recommendation that a 1x window scaling factor with a 1.5x font scaling factor should scale icons, buttons, toolbars etc in their units by 1.5x. There may also need to be a consistent way to load image resources at intermediate scales (or a recommendation to load the 2x resources and scale down).

This would result in apps at (window 1x, font 1.5x) would look about the same as they would have if (window 1.5x, font 1x) were supported... But might be a change for people who specifically wanted larger text but not larger icons and other widgets. Would that be likely to be problematic?

Thanks for any feedback and ideas -- and thanks everybody for all your work on making GTK+ an awesome toolkit for Linux (and cross-platform) apps!

-- brion
gtk-devel-list mailing list