Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116657

QScreen::geometry is not the same for Wayland and X11 with scaling

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.15, 6.7
    • GUI: High-DPI
    • None
    • Linux/Wayland, Linux/X11

    Description

      QScreen::geometry is not the same for Wayland and X11 with scaling. On Wayland, it uses "logical" geometry, which has sizes and positions based on each screen's device pixel ratio. On X11, the size is scaled, but the position is not. Because of this, QScreen (and pretty much any other part of Qt that uses global coordinates) doesn't make a great platform abstraction when dealing with UI scaling. In order to work around this, I had to do research, write more platform specific code and do trial and error testing. This is very time consuming when writing an app that uses lots of global coordinates, such as a screen capture app (in my case, KDE's Spectacle). If the coordinate systems for screen pixel geometry were more consistent, there would be fewer platform specific positioning bugs to watch out for.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            ndavis Noah Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes