What makes HiDPI work?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I'm testing Ubuntu Bionic, GNOME, elementary OS, KDE, Xfce 4.13 (the GTK3 version, all apps have been ported to GTK3).



All distros support hidpi across frameworks: when I launch Google Chrome/Firefox/etc. (GTK 3), VirtualBox (Qt 5), or Spotify (Electron) some component in the DE detects that my screen is 4K and does the right thing so that the app is scaled at 2x.



With the exception of Xfce. In Xfce, third-party apps don't work well, expecially Qt and Electron apps which are never launched at the correct scaling.



​Xfce 4.13 has a "scaling" option that you can use to specify that you want everything scaled to x2. However, even if I do that, Qt and Electron apps do not pick up the setting. I also tried using gsettings to set the "GNOME" setting in addition to Xfce's, to no avail. Qt and Electron apps still look bad, while on GNOME they look great out-of-the-box.



My Question is: how do Ubuntu, elementary and to a certain extent KDE make apps using different frameworks all scale correctly?



Of course, I know how to launch Qt apps at the correct scaling manually, but I'm wondering what makes this process so much easier on distros other than Xfce.



Is there a package that I can install from another distro that will make Xfce behave "correctly", so that if I launch a GTK3, Qt, or Electron app they get scaled correctly? Is it the launcher than passes some variables, or is it a lower-level component?










share|improve this question

























    up vote
    4
    down vote

    favorite












    I'm testing Ubuntu Bionic, GNOME, elementary OS, KDE, Xfce 4.13 (the GTK3 version, all apps have been ported to GTK3).



    All distros support hidpi across frameworks: when I launch Google Chrome/Firefox/etc. (GTK 3), VirtualBox (Qt 5), or Spotify (Electron) some component in the DE detects that my screen is 4K and does the right thing so that the app is scaled at 2x.



    With the exception of Xfce. In Xfce, third-party apps don't work well, expecially Qt and Electron apps which are never launched at the correct scaling.



    ​Xfce 4.13 has a "scaling" option that you can use to specify that you want everything scaled to x2. However, even if I do that, Qt and Electron apps do not pick up the setting. I also tried using gsettings to set the "GNOME" setting in addition to Xfce's, to no avail. Qt and Electron apps still look bad, while on GNOME they look great out-of-the-box.



    My Question is: how do Ubuntu, elementary and to a certain extent KDE make apps using different frameworks all scale correctly?



    Of course, I know how to launch Qt apps at the correct scaling manually, but I'm wondering what makes this process so much easier on distros other than Xfce.



    Is there a package that I can install from another distro that will make Xfce behave "correctly", so that if I launch a GTK3, Qt, or Electron app they get scaled correctly? Is it the launcher than passes some variables, or is it a lower-level component?










    share|improve this question























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I'm testing Ubuntu Bionic, GNOME, elementary OS, KDE, Xfce 4.13 (the GTK3 version, all apps have been ported to GTK3).



      All distros support hidpi across frameworks: when I launch Google Chrome/Firefox/etc. (GTK 3), VirtualBox (Qt 5), or Spotify (Electron) some component in the DE detects that my screen is 4K and does the right thing so that the app is scaled at 2x.



      With the exception of Xfce. In Xfce, third-party apps don't work well, expecially Qt and Electron apps which are never launched at the correct scaling.



      ​Xfce 4.13 has a "scaling" option that you can use to specify that you want everything scaled to x2. However, even if I do that, Qt and Electron apps do not pick up the setting. I also tried using gsettings to set the "GNOME" setting in addition to Xfce's, to no avail. Qt and Electron apps still look bad, while on GNOME they look great out-of-the-box.



      My Question is: how do Ubuntu, elementary and to a certain extent KDE make apps using different frameworks all scale correctly?



      Of course, I know how to launch Qt apps at the correct scaling manually, but I'm wondering what makes this process so much easier on distros other than Xfce.



      Is there a package that I can install from another distro that will make Xfce behave "correctly", so that if I launch a GTK3, Qt, or Electron app they get scaled correctly? Is it the launcher than passes some variables, or is it a lower-level component?










      share|improve this question













      I'm testing Ubuntu Bionic, GNOME, elementary OS, KDE, Xfce 4.13 (the GTK3 version, all apps have been ported to GTK3).



      All distros support hidpi across frameworks: when I launch Google Chrome/Firefox/etc. (GTK 3), VirtualBox (Qt 5), or Spotify (Electron) some component in the DE detects that my screen is 4K and does the right thing so that the app is scaled at 2x.



      With the exception of Xfce. In Xfce, third-party apps don't work well, expecially Qt and Electron apps which are never launched at the correct scaling.



      ​Xfce 4.13 has a "scaling" option that you can use to specify that you want everything scaled to x2. However, even if I do that, Qt and Electron apps do not pick up the setting. I also tried using gsettings to set the "GNOME" setting in addition to Xfce's, to no avail. Qt and Electron apps still look bad, while on GNOME they look great out-of-the-box.



      My Question is: how do Ubuntu, elementary and to a certain extent KDE make apps using different frameworks all scale correctly?



      Of course, I know how to launch Qt apps at the correct scaling manually, but I'm wondering what makes this process so much easier on distros other than Xfce.



      Is there a package that I can install from another distro that will make Xfce behave "correctly", so that if I launch a GTK3, Qt, or Electron app they get scaled correctly? Is it the launcher than passes some variables, or is it a lower-level component?







      linux ubuntu gnome xfce






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 28 at 21:06









      nbrogi

      738




      738




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted
          +50










          Unfortunately there is no such a global option to set. Those distributions are setting various variables for you.



          A lot of applications are taking the Xft.dpi setting from ~/.Xresources into account (That's the only option I've set but I barely use GUI applications)



          Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by exporting



          export QT_AUTO_SCREEN_SCALE_FACTOR=1


          If that doesn't work try



          export QT_AUTO_SCREEN_SCALE_FACTOR=0
          export QT_SCALE_FACTOR=2


          GDK 3 (GTK+ 3) can be scaled with



          export GDK_SCALE=2


          electron applications are difficult to handle on linux [1] [2]. They respect the text-scaling-factor option from GNOME for example [3].

          Here you have no choice but to use --force-device-scale-factor=1.5 as an argument.



          Well documented Arch Linux HiDPI wiki page for further reading






          share|improve this answer




















          • Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
            – nbrogi
            Aug 31 at 13:29







          • 1




            @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
            – i336_
            Sep 4 at 13:48










          • Nice, i336. ~/.config/xfce4/xinitrc looks promising.
            – nbrogi
            Sep 4 at 22:05










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f465383%2fwhat-makes-hidpi-work%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted
          +50










          Unfortunately there is no such a global option to set. Those distributions are setting various variables for you.



          A lot of applications are taking the Xft.dpi setting from ~/.Xresources into account (That's the only option I've set but I barely use GUI applications)



          Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by exporting



          export QT_AUTO_SCREEN_SCALE_FACTOR=1


          If that doesn't work try



          export QT_AUTO_SCREEN_SCALE_FACTOR=0
          export QT_SCALE_FACTOR=2


          GDK 3 (GTK+ 3) can be scaled with



          export GDK_SCALE=2


          electron applications are difficult to handle on linux [1] [2]. They respect the text-scaling-factor option from GNOME for example [3].

          Here you have no choice but to use --force-device-scale-factor=1.5 as an argument.



          Well documented Arch Linux HiDPI wiki page for further reading






          share|improve this answer




















          • Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
            – nbrogi
            Aug 31 at 13:29







          • 1




            @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
            – i336_
            Sep 4 at 13:48










          • Nice, i336. ~/.config/xfce4/xinitrc looks promising.
            – nbrogi
            Sep 4 at 22:05














          up vote
          1
          down vote



          accepted
          +50










          Unfortunately there is no such a global option to set. Those distributions are setting various variables for you.



          A lot of applications are taking the Xft.dpi setting from ~/.Xresources into account (That's the only option I've set but I barely use GUI applications)



          Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by exporting



          export QT_AUTO_SCREEN_SCALE_FACTOR=1


          If that doesn't work try



          export QT_AUTO_SCREEN_SCALE_FACTOR=0
          export QT_SCALE_FACTOR=2


          GDK 3 (GTK+ 3) can be scaled with



          export GDK_SCALE=2


          electron applications are difficult to handle on linux [1] [2]. They respect the text-scaling-factor option from GNOME for example [3].

          Here you have no choice but to use --force-device-scale-factor=1.5 as an argument.



          Well documented Arch Linux HiDPI wiki page for further reading






          share|improve this answer




















          • Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
            – nbrogi
            Aug 31 at 13:29







          • 1




            @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
            – i336_
            Sep 4 at 13:48










          • Nice, i336. ~/.config/xfce4/xinitrc looks promising.
            – nbrogi
            Sep 4 at 22:05












          up vote
          1
          down vote



          accepted
          +50







          up vote
          1
          down vote



          accepted
          +50




          +50




          Unfortunately there is no such a global option to set. Those distributions are setting various variables for you.



          A lot of applications are taking the Xft.dpi setting from ~/.Xresources into account (That's the only option I've set but I barely use GUI applications)



          Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by exporting



          export QT_AUTO_SCREEN_SCALE_FACTOR=1


          If that doesn't work try



          export QT_AUTO_SCREEN_SCALE_FACTOR=0
          export QT_SCALE_FACTOR=2


          GDK 3 (GTK+ 3) can be scaled with



          export GDK_SCALE=2


          electron applications are difficult to handle on linux [1] [2]. They respect the text-scaling-factor option from GNOME for example [3].

          Here you have no choice but to use --force-device-scale-factor=1.5 as an argument.



          Well documented Arch Linux HiDPI wiki page for further reading






          share|improve this answer












          Unfortunately there is no such a global option to set. Those distributions are setting various variables for you.



          A lot of applications are taking the Xft.dpi setting from ~/.Xresources into account (That's the only option I've set but I barely use GUI applications)



          Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by exporting



          export QT_AUTO_SCREEN_SCALE_FACTOR=1


          If that doesn't work try



          export QT_AUTO_SCREEN_SCALE_FACTOR=0
          export QT_SCALE_FACTOR=2


          GDK 3 (GTK+ 3) can be scaled with



          export GDK_SCALE=2


          electron applications are difficult to handle on linux [1] [2]. They respect the text-scaling-factor option from GNOME for example [3].

          Here you have no choice but to use --force-device-scale-factor=1.5 as an argument.



          Well documented Arch Linux HiDPI wiki page for further reading







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 31 at 8:18









          ploth

          848115




          848115











          • Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
            – nbrogi
            Aug 31 at 13:29







          • 1




            @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
            – i336_
            Sep 4 at 13:48










          • Nice, i336. ~/.config/xfce4/xinitrc looks promising.
            – nbrogi
            Sep 4 at 22:05
















          • Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
            – nbrogi
            Aug 31 at 13:29







          • 1




            @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
            – i336_
            Sep 4 at 13:48










          • Nice, i336. ~/.config/xfce4/xinitrc looks promising.
            – nbrogi
            Sep 4 at 22:05















          Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
          – nbrogi
          Aug 31 at 13:29





          Hi, thanks for your answer. I too have found HiDPI wiki page to be the best source for this info, and use it as a reference to launch apps manually. However, I was looking into something permanent and programmatical. So, if distros set those variables for you, what is the package for instance in Ubuntu Bionic which does it? Is it directly the installer? Do they write to your home folder, so should I investigate there?
          – nbrogi
          Aug 31 at 13:29





          1




          1




          @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
          – i336_
          Sep 4 at 13:48




          @nbrogi: Try putting the values that you've found to work in ~/.bashrc, ~/.xinitrc, /etc/profile, or (if my brief google about XFCE returned sane results) ~/.config/xfce4/xinitrc.
          – i336_
          Sep 4 at 13:48












          Nice, i336. ~/.config/xfce4/xinitrc looks promising.
          – nbrogi
          Sep 4 at 22:05




          Nice, i336. ~/.config/xfce4/xinitrc looks promising.
          – nbrogi
          Sep 4 at 22:05

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f465383%2fwhat-makes-hidpi-work%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay