<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>So I tested this on my Asahi Fedora Linux KDE setup. So you were
      right about the scaling-factor being set to 1, but I'm still a
      little bit confused about this situation.</p>
    <p>If I go into the KDE settings, and change the display scaling to
      150% for example, other (native) applications somehow get scaled
      appropriately. However, the scaling-factor property in gsettings
      is an integer and gets rounded down. So if I set display scaling
      to 150% in the settings, it will still get rounded down to one,
      leading to a wrong scaling for JavaFX applications. I would argue
      that JavaFX applications not scaling correctly on KDE systems is
      not a small issue as it makes some applications unusable unless
      the developer add support for custom scaling explicitly. So I have
      two questions:<br>
      - Is the default dpi calculation also error prone? If not, why not
      always use the manual calculation on KDE systems<br>
      - Are there better alternatives to the gsettings scaling-factor?
      Something like <code>org.gnome.desktop.interface
        text-scaling-factor</code></p>
    <div class="moz-cite-prefix">On 16/02/2024 21:31, Martin Fox wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:3FDC27F8-0BD5-466F-B099-0100843974D3@martinfox.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      Hi Christopher,
      <div><br>
      </div>
      <div>This may be a side-effect of using KDE. To determine the UI
        scale the JavaFX code consults the “scaling-factor” setting in
        the “org.gnome.desktop.interface” schema. You can check this on
        the command line:</div>
      <div><br>
      </div>
      <div><span class="Apple-tab-span" style="white-space:pre">        </span>gsettings
        get org.gnome.desktop.interface scaling-factor</div>
      <div><br>
      </div>
      <div>This should be 0 so JavaFX can compute the scale itself. If
        it’s greater than 0 that’s the value JavaFX will use for the UI
        scale.</div>
      <div><br>
      </div>
      <div>It appears that a KDE install can set this value to 1. In my
        case I started with the ARM version of Ubuntu server and then
        installed KDE (kubuntu-desktop) and afterward the scaling-factor
        was 1. This doesn’t happen when installing the standard GNOME
        desktop.</div>
      <div><br>
      </div>
      <div>Martin</div>
      <div><br>
        <div>
          <blockquote type="cite">
            <div>On Feb 13, 2024, at 2:13 AM, Christopher Schnick
              <a class="moz-txt-link-rfc2396E" href="mailto:crschnick@xpipe.io"><crschnick@xpipe.io></a> wrote:</div>
            <br class="Apple-interchange-newline">
            <div>
              <meta http-equiv="content-type"
                content="text/html; charset=UTF-8">
              <div>
                <p> Hello,</p>
                <p>several users of our JavaFX applications have
                  reported that the UI scale is too small when the
                  physical and logical screen resolutions differ on
                  Linux. For example in this case</p>
                <p><span id="cid:part1.NldnHeEq.shgAL10K@xpipe.io"><Screenshot_20240125_115224(1).png></span></p>
                <p>there is an implicit scaling factor of 150% included
                  as the monitor is a 4k display but is using a lowered
                  resolution of 2560x1440. This is then further
                  stretched as the OS resolution is 1920x1080, but the
                  main problem is that the 150% factor is somehow not
                  getting picked up and JavaFX is treating this as a 4k
                  display, thus making everything too small. For now
                  these users can use <span
style="margin: 0px; padding: 0px; border: 0px; font-weight: 400; font-style: normal; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; vertical-align: baseline; outline: 0px; color: rgb(219, 222, 225); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: break-spaces; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(49, 51, 56); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">-Dglass</span><span
style="margin: 0px; padding: 0px; border: 0px; font-weight: 400; font-style: normal; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; vertical-align: baseline; outline: 0px; color: rgb(219, 222, 225); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: break-spaces; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(49, 51, 56); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">.gtk</span><span
style="margin: 0px; padding: 0px; border: 0px; font-weight: 400; font-style: normal; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; vertical-align: baseline; outline: 0px; color: rgb(219, 222, 225); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: break-spaces; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(49, 51, 56); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">.uiScale</span><span
style="margin: 0px; padding: 0px; border: 0px; font-weight: 400; font-style: normal; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; vertical-align: baseline; outline: 0px; color: rgb(219, 222, 225); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: break-spaces; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(49, 51, 56); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">=</span>1.5
                  but that is not a nice solution to this problem.<br>
                </p>
                <p>Best<br>
                  Christopher Schnick<br>
                </p>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
  </body>
</html>