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

Window mask broken when moving from one monitor to another with different high DPI scaling factor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P2: Important P2: Important
    • None
    • 5.11.2
    • GUI: High-DPI
    • None
    • Linux/X11

      I am using the environment variable QT_SCREEN_SCALE_FACTORS="A=1;B=2" to simulate a dual-monitor setup with different scale factors on each monitor. I've found that QWidget::setMask doesn't work properly in this situation.

      I have implemented a custom window which calls QWidget::setMask inside QWidget::resizeEvent, to keep the mask up-to-date with the actual widget size. Normally this works fine, however when I move the window to a different monitor with setGeometry, the mask becomes broken. It seems that Qt is internally still using the old scale factor when generating the mask, so it ends up being either 2x too small or too large.

      It also seems that Qt makes no attempt to rescale the existing mask if I don't explicitly call QWidget::setMask.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            maarten baert Maarten Baert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes