Important: Please read the Qt Code of Conduct -

Position of Widget with Fractional Scaling

  • 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:

    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.

  • Lifetime Qt Champion

    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 ?

  • 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.

  • Lifetime Qt Champion

    Are you using VirtualBox ?

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

  • Lifetime Qt Champion

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

Log in to reply