<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>358689</bug_id>
          
          <creation_ts>2016-01-28 16:57:32 +0000</creation_ts>
          <short_desc>[X11] Support Qt 5.6 new highdpi environment variable</short_desc>
          <delta_ts>2022-01-21 05:14:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>systemsettings</product>
          <component>kcm_kscreen</component>
          <version>5.14.3</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>414866</dup_id>
          <see_also>https://bugs.kde.org/show_bug.cgi?id=414866</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Weng Xuetian">wengxt</reporter>
          <assigned_to name="kscreen-bugs-null@kde.org">kscreen-bugs-null</assigned_to>
          <cc>chalkerx</cc>
    
    <cc>kde</cc>
    
    <cc>kfunk</cc>
    
    <cc>mgraesslin</cc>
    
    <cc>nate</cc>
    
    <cc>null</cc>
    
    <cc>plasma-bugs-null</cc>
    
    <cc>postix</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1573277</commentid>
    <comment_count>0</comment_count>
    <who name="Weng Xuetian">wengxt</who>
    <bug_when>2016-01-28 16:57:32 +0000</bug_when>
    <thetext>For more details: https://doc-snapshots.qt.io/qt5-5.6/highdpi.html
QT_DEVICE_PIXEL_RATIO is deprecated but still supported by Qt 5.6.
New environment variable includes QT_AUTO_SCREEN_SCALE_FACTOR, 
QT_SCALE_FACTOR, and QT_SCREEN_SCALE_FACTORS.

And now it is possible to configure per screen scale factor via environment variable. 

Reproducible: Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1586398</commentid>
    <comment_count>1</comment_count>
    <who name="Nikita Skovoroda">chalkerx</who>
    <bug_when>2016-04-03 13:01:43 +0000</bug_when>
    <thetext>Setting QT_SCREEN_SCALE_FACTORS=2 seems to do exactly the same as QT_DEVICE_PIXEL_RATIO=2 did before 5.6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1586399</commentid>
    <comment_count>2</comment_count>
    <who name="Nikita Skovoroda">chalkerx</who>
    <bug_when>2016-04-03 13:02:52 +0000</bug_when>
    <thetext>See also https://bugreports.qt.io/browse/QTBUG-52285</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1586401</commentid>
    <comment_count>3</comment_count>
    <who name="Nikita Skovoroda">chalkerx</who>
    <bug_when>2016-04-03 13:07:25 +0000</bug_when>
    <thetext>QT_AUTO_SCREEN_SCALE_FACTOR enables the auto-scaling, which has certain issues (it does not calculate the correct scale on notebooks, for example), see https://bugreports.qt.io/browse/QTBUG-52202

QT_SCALE_FACTOR is an _additional_ scaling factor, and that one also scales fonts, which are already adjusted by the dpi setting (and forcing dpi to 96 would break other apps).

http://doc.qt.io/qt-5/highdpi.html#qt-support</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1609470</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2016-07-20 16:41:18 +0000</bug_when>
    <thetext>@David: this should be fixed by 440a3d7c2035c742c32f104076acd320916fed14 in plasma-workspace, shouldn&apos;t it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1609595</commentid>
    <comment_count>5</comment_count>
    <who name="Weng Xuetian">wengxt</who>
    <bug_when>2016-07-21 04:17:19 +0000</bug_when>
    <thetext>Emm, I&apos;d prefer leave it open until it support real &quot;per screen&quot; setting instead of set same ratio for all screen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1609604</commentid>
    <comment_count>6</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2016-07-21 05:57:07 +0000</bug_when>
    <thetext>(In reply to Weng Xuetian from comment #5)
&gt; Emm, I&apos;d prefer leave it open until it support real &quot;per screen&quot; setting
&gt; instead of set same ratio for all screen.

we cannot have per screen on X11.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1609788</commentid>
    <comment_count>7</comment_count>
    <who name="Weng Xuetian">wengxt</who>
    <bug_when>2016-07-21 16:21:53 +0000</bug_when>
    <thetext>This setting has nothing to do with X11, it&apos;s just for Qt itself.

you can set it like:
QT_SCREEN_SCALE_FACTORS=eDP1=2;eDP2=3

So when you move window among screen, the Qt&apos;s window will be rescaled to the screen dpi automatically.

Right now kscreen can only set it to the same value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1609859</commentid>
    <comment_count>8</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2016-07-22 05:34:20 +0000</bug_when>
    <thetext>(In reply to Weng Xuetian from comment #7)
&gt; This setting has nothing to do with X11, it&apos;s just for Qt itself.
&gt; 
&gt; you can set it like:
&gt; QT_SCREEN_SCALE_FACTORS=eDP1=2;eDP2=3
&gt; 
&gt; So when you move window among screen, the Qt&apos;s window will be rescaled to
&gt; the screen dpi automatically.

That cannot work on X11, sorry. That&apos;s just Qt&apos;s &quot;I don&apos;t know how to multi-screen on X11&quot;. The problems here are:
* a window is not connected with an output, it has a position within the X screen space
* QWindow allows to set the QScreen, but this does not influence whether the window is sown on the screen
* DPI for multi-screen on common X-Servers is broken. As soon as there are two screens, the X-Server does report a default 96 pdi AFAIK
* when moving a window from one screen to another it could result in an infinite jumping between the different DPI modes
* the totally legit situation of one window on two screens is not handled
* the window manager does not adjust the window decoration
* I could go on and on

Exposing a config option for that would be wrong: we cannot have different scale factors on X11. That would just introduce another set of things which can go wrong with Qt&apos;s utterly broken (and broken beyond repair) multi-screen implementation on X11.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1609977</commentid>
    <comment_count>9</comment_count>
    <who name="Weng Xuetian">wengxt</who>
    <bug_when>2016-07-22 21:30:14 +0000</bug_when>
    <thetext>(In reply to Martin Gräßlin from comment #8)
&gt; (In reply to Weng Xuetian from comment #7)
&gt; &gt; This setting has nothing to do with X11, it&apos;s just for Qt itself.
&gt; &gt; 
&gt; &gt; you can set it like:
&gt; &gt; QT_SCREEN_SCALE_FACTORS=eDP1=2;eDP2=3
&gt; &gt; 
&gt; &gt; So when you move window among screen, the Qt&apos;s window will be rescaled to
&gt; &gt; the screen dpi automatically.
&gt; 
&gt; That cannot work on X11, sorry. That&apos;s just Qt&apos;s &quot;I don&apos;t know how to
&gt; multi-screen on X11&quot;. The problems here are:
&gt; * a window is not connected with an output, it has a position within the X
&gt; screen space
&gt; * QWindow allows to set the QScreen, but this does not influence whether the
&gt; window is sown on the screen
&gt; * DPI for multi-screen on common X-Servers is broken. As soon as there are
&gt; two screens, the X-Server does report a default 96 pdi AFAIK
&gt; * when moving a window from one screen to another it could result in an
&gt; infinite jumping between the different DPI modes
&gt; * the totally legit situation of one window on two screens is not handled
&gt; * the window manager does not adjust the window decoration
&gt; * I could go on and on
&gt; 
&gt; Exposing a config option for that would be wrong: we cannot have different
&gt; scale factors on X11. That would just introduce another set of things which
&gt; can go wrong with Qt&apos;s utterly broken (and broken beyond repair)
&gt; multi-screen implementation on X11.

Such complain doesn&apos;t solve anything. You&apos;re just pointing to some &quot;Potential&quot; Problem that doesn&apos;t really happen. 

I have been using QT_DEVICE_PIXEL_RATIO=auto (when it&apos;s still old style env var) since Qt 5.4, and it never cause me any trouble. Dynamically change window&apos;s scale factor is tricky, but it&apos;s also the same approach on Windows. 

I have been use it for such a long time. And if any issue you claim actually happens, Qt should fix it. Not to mention IT IS not the case. I have even seen user complain about startkde script prevent user to set QT_AUTO_SCREEN_SCALE_FACTOR to 1. It&apos;s not something badly broken, really.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870070</commentid>
    <comment_count>10</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2019-07-20 14:03:06 +0000</bug_when>
    <thetext>There&apos;s a patch that implements this feature: https://phabricator.kde.org/D12405</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870099</commentid>
    <comment_count>11</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2019-07-20 18:38:33 +0000</bug_when>
    <thetext>That patch also expands on what breaks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2096286</commentid>
    <comment_count>12</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-01-21 05:14:28 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 414866 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>