High DPi screen xrandr scaling on ubuntu 18.04 LTS












1














I just installed Ubuntu 18.04 LTS in dual boot with Windows 10 on my Thinkpad X1 Yoga 2nd gen which has a high dpi screen (2560x1440). Since the GUI settings do not permit fractional scaling (and 100% is too small while 200% is too big) I followed the intructions in this page.



However, running the following command from terminal



xrandr --output eDP-1 --scale 1.3x1.3 --panning 2560x1440


I get a pretty bad result where the desktop is resized and I get black borders. Moreover I can drag windows in the balck borders but they leave a trace beheind (picture here).



I think it may be a conflict between xrandr and the Gnome desktop enviromment, but it's just a guess. Any suggestions on how to solve this bug?










share|improve this question





























    1














    I just installed Ubuntu 18.04 LTS in dual boot with Windows 10 on my Thinkpad X1 Yoga 2nd gen which has a high dpi screen (2560x1440). Since the GUI settings do not permit fractional scaling (and 100% is too small while 200% is too big) I followed the intructions in this page.



    However, running the following command from terminal



    xrandr --output eDP-1 --scale 1.3x1.3 --panning 2560x1440


    I get a pretty bad result where the desktop is resized and I get black borders. Moreover I can drag windows in the balck borders but they leave a trace beheind (picture here).



    I think it may be a conflict between xrandr and the Gnome desktop enviromment, but it's just a guess. Any suggestions on how to solve this bug?










    share|improve this question



























      1












      1








      1







      I just installed Ubuntu 18.04 LTS in dual boot with Windows 10 on my Thinkpad X1 Yoga 2nd gen which has a high dpi screen (2560x1440). Since the GUI settings do not permit fractional scaling (and 100% is too small while 200% is too big) I followed the intructions in this page.



      However, running the following command from terminal



      xrandr --output eDP-1 --scale 1.3x1.3 --panning 2560x1440


      I get a pretty bad result where the desktop is resized and I get black borders. Moreover I can drag windows in the balck borders but they leave a trace beheind (picture here).



      I think it may be a conflict between xrandr and the Gnome desktop enviromment, but it's just a guess. Any suggestions on how to solve this bug?










      share|improve this question















      I just installed Ubuntu 18.04 LTS in dual boot with Windows 10 on my Thinkpad X1 Yoga 2nd gen which has a high dpi screen (2560x1440). Since the GUI settings do not permit fractional scaling (and 100% is too small while 200% is too big) I followed the intructions in this page.



      However, running the following command from terminal



      xrandr --output eDP-1 --scale 1.3x1.3 --panning 2560x1440


      I get a pretty bad result where the desktop is resized and I get black borders. Moreover I can drag windows in the balck borders but they leave a trace beheind (picture here).



      I think it may be a conflict between xrandr and the Gnome desktop enviromment, but it's just a guess. Any suggestions on how to solve this bug?







      gnome 18.04 xorg display-resolution xrandr






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 29 at 13:16

























      asked Oct 29 at 11:18









      Alessandro Piazza

      63




      63






















          2 Answers
          2






          active

          oldest

          votes


















          2














          I had this issue too. Something that worked for me is to run the two parts of the command separately:



          xrandr --output eDP-1 --scale 1.25x1.25
          xrandr --output eDP-1 --panning 2560x1440


          I then don't get the black borders. This didn't work in a start-up script, however -- I have to run this every time I log in.



          After I suspend and resume, however, the black borders show up again. If anyone has any tips for getting around that, that'd be appreciated.






          share|improve this answer





























            0














            This answers both the OP's question and the other answer's bonus question.





            Create a script using:



            sudo -H gedit /lib/systemd/system-sleep/scale


            Copy these lines into gedit:



            #!/bin/bash

            # NAME: scale
            # PATH: /lib/systemd/system-sleep
            # DESC: Reset Ethernet card after suspend, not working automatically
            # DATE: Dec 8, 2018


            MYNAME=$0

            set_scale() {
            xrandr --output eDP-1 --scale 1.3x1.3
            xrandr --output eDP-1 --panning 2560x1440
            }

            /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
            case "${1}/${2}" in
            hibernate|suspend|pre*)
            ;;
            resume|thaw|post*)
            # sleep 2;
            set_scale;;
            esac


            Save the script and exit gedit.



            Mark the script executable using:



            chmod a+x /lib/systemd/system-sleep/scale


            The script will run every time you resume from suspend.



            You can also have it run in your startup applications by adding an entry containing the command:



            /lib/systemd/system-sleep/scale post suspend


            Startup Applications are run after you sign on.






            share|improve this answer





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1088233%2fhigh-dpi-screen-xrandr-scaling-on-ubuntu-18-04-lts%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              I had this issue too. Something that worked for me is to run the two parts of the command separately:



              xrandr --output eDP-1 --scale 1.25x1.25
              xrandr --output eDP-1 --panning 2560x1440


              I then don't get the black borders. This didn't work in a start-up script, however -- I have to run this every time I log in.



              After I suspend and resume, however, the black borders show up again. If anyone has any tips for getting around that, that'd be appreciated.






              share|improve this answer


























                2














                I had this issue too. Something that worked for me is to run the two parts of the command separately:



                xrandr --output eDP-1 --scale 1.25x1.25
                xrandr --output eDP-1 --panning 2560x1440


                I then don't get the black borders. This didn't work in a start-up script, however -- I have to run this every time I log in.



                After I suspend and resume, however, the black borders show up again. If anyone has any tips for getting around that, that'd be appreciated.






                share|improve this answer
























                  2












                  2








                  2






                  I had this issue too. Something that worked for me is to run the two parts of the command separately:



                  xrandr --output eDP-1 --scale 1.25x1.25
                  xrandr --output eDP-1 --panning 2560x1440


                  I then don't get the black borders. This didn't work in a start-up script, however -- I have to run this every time I log in.



                  After I suspend and resume, however, the black borders show up again. If anyone has any tips for getting around that, that'd be appreciated.






                  share|improve this answer












                  I had this issue too. Something that worked for me is to run the two parts of the command separately:



                  xrandr --output eDP-1 --scale 1.25x1.25
                  xrandr --output eDP-1 --panning 2560x1440


                  I then don't get the black borders. This didn't work in a start-up script, however -- I have to run this every time I log in.



                  After I suspend and resume, however, the black borders show up again. If anyone has any tips for getting around that, that'd be appreciated.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 8 at 21:29









                  Olof

                  212




                  212

























                      0














                      This answers both the OP's question and the other answer's bonus question.





                      Create a script using:



                      sudo -H gedit /lib/systemd/system-sleep/scale


                      Copy these lines into gedit:



                      #!/bin/bash

                      # NAME: scale
                      # PATH: /lib/systemd/system-sleep
                      # DESC: Reset Ethernet card after suspend, not working automatically
                      # DATE: Dec 8, 2018


                      MYNAME=$0

                      set_scale() {
                      xrandr --output eDP-1 --scale 1.3x1.3
                      xrandr --output eDP-1 --panning 2560x1440
                      }

                      /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
                      case "${1}/${2}" in
                      hibernate|suspend|pre*)
                      ;;
                      resume|thaw|post*)
                      # sleep 2;
                      set_scale;;
                      esac


                      Save the script and exit gedit.



                      Mark the script executable using:



                      chmod a+x /lib/systemd/system-sleep/scale


                      The script will run every time you resume from suspend.



                      You can also have it run in your startup applications by adding an entry containing the command:



                      /lib/systemd/system-sleep/scale post suspend


                      Startup Applications are run after you sign on.






                      share|improve this answer


























                        0














                        This answers both the OP's question and the other answer's bonus question.





                        Create a script using:



                        sudo -H gedit /lib/systemd/system-sleep/scale


                        Copy these lines into gedit:



                        #!/bin/bash

                        # NAME: scale
                        # PATH: /lib/systemd/system-sleep
                        # DESC: Reset Ethernet card after suspend, not working automatically
                        # DATE: Dec 8, 2018


                        MYNAME=$0

                        set_scale() {
                        xrandr --output eDP-1 --scale 1.3x1.3
                        xrandr --output eDP-1 --panning 2560x1440
                        }

                        /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
                        case "${1}/${2}" in
                        hibernate|suspend|pre*)
                        ;;
                        resume|thaw|post*)
                        # sleep 2;
                        set_scale;;
                        esac


                        Save the script and exit gedit.



                        Mark the script executable using:



                        chmod a+x /lib/systemd/system-sleep/scale


                        The script will run every time you resume from suspend.



                        You can also have it run in your startup applications by adding an entry containing the command:



                        /lib/systemd/system-sleep/scale post suspend


                        Startup Applications are run after you sign on.






                        share|improve this answer
























                          0












                          0








                          0






                          This answers both the OP's question and the other answer's bonus question.





                          Create a script using:



                          sudo -H gedit /lib/systemd/system-sleep/scale


                          Copy these lines into gedit:



                          #!/bin/bash

                          # NAME: scale
                          # PATH: /lib/systemd/system-sleep
                          # DESC: Reset Ethernet card after suspend, not working automatically
                          # DATE: Dec 8, 2018


                          MYNAME=$0

                          set_scale() {
                          xrandr --output eDP-1 --scale 1.3x1.3
                          xrandr --output eDP-1 --panning 2560x1440
                          }

                          /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
                          case "${1}/${2}" in
                          hibernate|suspend|pre*)
                          ;;
                          resume|thaw|post*)
                          # sleep 2;
                          set_scale;;
                          esac


                          Save the script and exit gedit.



                          Mark the script executable using:



                          chmod a+x /lib/systemd/system-sleep/scale


                          The script will run every time you resume from suspend.



                          You can also have it run in your startup applications by adding an entry containing the command:



                          /lib/systemd/system-sleep/scale post suspend


                          Startup Applications are run after you sign on.






                          share|improve this answer












                          This answers both the OP's question and the other answer's bonus question.





                          Create a script using:



                          sudo -H gedit /lib/systemd/system-sleep/scale


                          Copy these lines into gedit:



                          #!/bin/bash

                          # NAME: scale
                          # PATH: /lib/systemd/system-sleep
                          # DESC: Reset Ethernet card after suspend, not working automatically
                          # DATE: Dec 8, 2018


                          MYNAME=$0

                          set_scale() {
                          xrandr --output eDP-1 --scale 1.3x1.3
                          xrandr --output eDP-1 --panning 2560x1440
                          }

                          /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
                          case "${1}/${2}" in
                          hibernate|suspend|pre*)
                          ;;
                          resume|thaw|post*)
                          # sleep 2;
                          set_scale;;
                          esac


                          Save the script and exit gedit.



                          Mark the script executable using:



                          chmod a+x /lib/systemd/system-sleep/scale


                          The script will run every time you resume from suspend.



                          You can also have it run in your startup applications by adding an entry containing the command:



                          /lib/systemd/system-sleep/scale post suspend


                          Startup Applications are run after you sign on.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 9 at 1:01









                          WinEunuuchs2Unix

                          42.3k1072162




                          42.3k1072162






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1088233%2fhigh-dpi-screen-xrandr-scaling-on-ubuntu-18-04-lts%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Quarter-circle Tiles

                              build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                              Mont Emei