Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Position of Widget with Fractional Scaling
Forum Updated to NodeBB v4.3 + New Features

Position of Widget with Fractional Scaling

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jeremyb
    wrote on last edited by
    #1

    Hello,

    I am a maintainer for flameshot (crossplatform FOSS screenshot application). There is a bug that has been unsolved for a couple years where when a user is on X11 with fractional scaling, the widget that displays the screenshot is not centered on the screen. I am really struggling to figure this out.

    I created a minimal working example of this bug and posted it here: https://github.com/borgmanJeremy/mwe_fractional_scaling_bug

    If you run the example on X11 with scaling set to 1.0, you will see that the screen shot is perfectly centered on the screen. Once fractional scaling is enabled there is an offset that I have a hard time detecting and fixing.

    Here is a picture of what it looks like in a VM with fractional scaling: issue

    Note: the MWE does not have a way to quit and launches in fullscreen. I recommend running it in a VM or be ready to drop to tty to kill it. I didnt want to clutter the code with anything unrelated to the bug.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What distribution are you using ?

      Since you mention a VM, can you also provide how you installed it to reproduce that issue ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jeremyb
        wrote on last edited by
        #3

        The picture is from a kubuntu20.10 VM, but I have triggered it on basically every modern distro using X11.

        To generally trigger the bug, you just need 2 or more monitors with a scaling factor that !=1. I have also triggered in on my real PC, just easier to troubleshoot in a VM.

        My VM is running headless on a home server. Then I use SPICE to stream the video locally. The resolution of the VM is 2x monitors at 1920x1080 and a scale factor of 1.25. The spice driver is great for VM's because by default the resolution of the VM will scale to the window size.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you using VirtualBox ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply
          0
          • SGaistS SGaist

            Are you using VirtualBox ?

            J Offline
            J Offline
            jeremyb
            wrote on last edited by
            #5

            @SGaist No I was using KVM + Qemu. Then remote viewer to view the spice session. But again, it happens on native hardware as well.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I just heard in a presentation that fractional scaling support should be good in Qt 6.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jisbetterthanj
                wrote on last edited by
                #7

                A workaround that seem seems to work fine for me on X11 (mesa) is to simply run flameshot with the environment variable:

                PLASMA_USE_QT_SCALING=1
                

                sysinfo:

                Operating System: Ubuntu 24.04 |  KDE Plasma Version: 5.27.11 KDE Frameworks Version 5.115.0 Qt Version: 5.15.13
                
                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  alexamy
                  wrote on last edited by
                  #8

                  For some reason previous workaround stop working for me on new system installation. But this works:

                  env QT_SCREEN_SCALE_FACTORS=1 flameshot gui
                  

                  System info:

                  Debian GNU/Linux 12 (bookworm)
                  plasmashell 5.27.5
                  KDE Frameworks: 5.103.0
                  Qt: 5.15.8
                  x11
                  
                  Flameshot v12.1.0 (Debian 12.1.0-2)
                  Compiled with Qt 5.15.8
                  
                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved