RE: [fltk.coredev] Windows and Linux scale_factor (hiDPI) trouble - [General Use]

69 views
Skip to first unread message

MacArthur, Ian (Leonardo, UK)

unread,
Aug 6, 2020, 7:42:05 AM8/6/20
to fltkc...@googlegroups.com
> My problem is that Linux reports a scale factor of 2.0, when it should
> be reporting a screen scale of 1.25.
> I solved the issue with Windows, but Linux reports an incorrect screen_scale.

> > What do you mean exactly by "Linux reports a scale factor of 2.0" ?
> > The scale factor known to FLTK is visible with the test program test/fullscreen.

> And indeed it does.  When I set the Desktop preferences to 125% (or any other setting other than 100%), I get:
> Screen 0: 1536x864@0,0 DPI:95.6x94.6 scale:2.00
> To set the scaling factor for my screen I am RMB on the Desktop->Display (or is it Screen) Configuration
> and setting Scale to a different value (and Apply).


I seem to remember that there was an issue with X11 servers, or maybe it was some WM's, only handling integer scale factors, at least at some point, so it is possible that it really is 2, I guess?



Leonardo MW Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

Albrecht Schlosser

unread,
Aug 6, 2020, 8:05:11 AM8/6/20
to fltkc...@googlegroups.com
On 8/6/20 1:42 PM MacArthur, Ian (Leonardo, UK) wrote:
[Gonzalo wrote:]
>> And indeed it does.  When I set the Desktop preferences to 125% (or any other setting other than 100%), I get:
>> Screen 0: 1536x864@0,0 DPI:95.6x94.6 scale:2.00
>> To set the scaling factor for my screen I am RMB on the Desktop->Display (or is it Screen) Configuration
>> and setting Scale to a different value (and Apply).
>
> I seem to remember that there was an issue with X11 servers, or maybe it was some WM's, only handling integer scale factors, at least at some point, so it is possible that it really is 2, I guess?

I can't remember for sure and couldn't find it, but I believe that
Gonzalo mentioned Ubuntu.

Reading the following article which is about Linux Mint but mentions
Ubuntu which Mint is based on, I get the impression that Ubuntu doesn't
support other scaling factors than 1.0 and 2.0:

https://www.omgubuntu.co.uk/2020/02/cinnamon-desktop-fractional-scaling-support

Citation, regarding Linux Mint 20:

“By being able to set the scaling for each monitor independently and
allow for scaling values of not only 100% and 200% but also 125%, 150%,
175%, we’re hoping to get higher pixel density and allow HiDPI and
non-HiDPI monitors to play well with each others.”

... and further:

"If Mint can stick the landing of this feature then the Cinnamon desktop
and Linux Mint, which uses Cinnamon by default, will gain a major
selling point over regular Ubuntu."

See the last cited sentence.

Well, that could also mean that you'd get it on Ubuntu as well if you
used the Cinnamon desktop.

gga

unread,
Aug 6, 2020, 8:38:38 AM8/6/20
to fltkc...@googlegroups.com

On 6/8/20 09:05, Albrecht Schlosser wrote:
>
> I can't remember for sure and couldn't find it, but I believe that
> Gonzalo mentioned Ubuntu.
>
Yes, I am on Ubuntu.
> Reading the following article which is about Linux Mint but mentions
> Ubuntu which Mint is based on, I get the impression that Ubuntu
> doesn't support other scaling factors than 1.0 and 2.0:
>
> https://www.omgubuntu.co.uk/2020/02/cinnamon-desktop-fractional-scaling-support
>
>
> Citation, regarding Linux Mint 20:
>
> “By being able to set the scaling for each monitor independently and
> allow for scaling values of not only 100% and 200% but also 125%,
> 150%, 175%, we’re hoping to get higher pixel density and allow HiDPI
> and non-HiDPI monitors to play well with each others.”
>
Well, the option to set at least one monitor at 125, 150 and 175% is
there in Gnome and it works.
> ... and further:
>
> "If Mint can stick the landing of this feature then the Cinnamon
> desktop and Linux Mint, which uses Cinnamon by default, will gain a
> major selling point over regular Ubuntu."
>
> See the last cited sentence.
>
> Well, that could also mean that you'd get it on Ubuntu as well if you
> used the Cinnamon desktop.
>
I tried Cinnamon and it gave me only two choices for my monitor: Normal
and hiDPI.  No percentages at all :(  I guess I don't have the latest
cinnamon yet.

--
Gonzalo Garramuño

Albrecht Schlosser

unread,
Aug 6, 2020, 1:03:54 PM8/6/20
to fltkc...@googlegroups.com
Citing the article (date: Feb 2020):
"Cinnamon 4.6 is expected to introduce support for fractional scaling
when it’s released later this year..."

So it ought to be at least 4.6 *if* it was introduced in that version as
expected by the author.

Manolo

unread,
Aug 6, 2020, 1:03:58 PM8/6/20
to fltk.coredev
The scale factor FLTK uses under Linux is the value of the Xft.dpi X resource
divided by 96.
That value can be read by command
    xrdb -query
The FLTK scale factor can be further changed typing ctrl-+, or using
the FLTK_SCALING_FACTOR  environment variable. This is all described at:

Under Ubuntu, the settings application, Displays item, allows to set the scale
to 100% or 200%. Setting it to 200% gives Xft.dpi the value 192 and the value 2 to the
FLTK scaling factor (test/fullscreen shows this value).
Recently an option called "Fractional scaling" appeared
allowing to set it to 125%, 150% etc. Under Virtualbox I use, that's not usable
so I don't known how it works.

To get fractional scale values, another app called "Tweaks" is useful.
Its "Fonts" item contains a "Scaling factor" value that can be set at will
to fractional values (e.g. 1.27) and that in fact controls Xft.dpi,
which FLTK follows, as written above.

What is the meaning of
    "I solved the issue with Windows, but Linux reports an incorrect screen_scale." ?
Does the GL window draw correctly under Linux also?

gga

unread,
Aug 8, 2020, 4:51:40 PM8/8/20
to fltkc...@googlegroups.com

On 6/8/20 14:03, Manolo wrote:
>     "I solved the issue with Windows, but Linux reports an incorrect
> screen_scale." ?
> Does the GL window draw correctly under Linux also?
Yes, the GL window draws correctly.  If I use the Tweaks utility it does.

--
Gonzalo Garramuño

Reply all
Reply to author
Forward
0 new messages