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

Mac: drop-downs don't work when in the right or bottom and QT_SCALE_FACTOR is used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.10, 5.14.2, 5.15.2
    • Fix Version/s: None
    • Component/s: GUI: High-DPI
    • Labels:
      None
    • Platform/s:
      macOS

      Description

      We use Qt inside Adobe Illustrator. Illustrator offers custom UI scaling on top of OS scaling. We use QT_SCALE_FACTOR to have the extra scaling also in our Qt UI.

      When QT_SCALE_FACTOR is set (and > 1.0) the following issue occurs on macOS:

      When a drop-down is close to the right or bottom edge of the screen, then clicking on the drop-down does nothing, instead of showing a pop-up with all the entries.

      Namely, when QT_SCALE_FACTOR is 1.5, then it is the right resp. bottom 33% of the screen. If it is 2.0, then it is 50% on the right and 50% at the bottom.

      The rootcause: QWindow uses the logical coordinates, whereas QPlatformWindow and QCocoaWindow use the screen or native coordinates. Therefore when passing coordinates between these 2 objects, they need to be converted to or from native,

      Therefore, I believe the call window()->setGeometry(geometry()) in QCocoaWindow::initialize() is wrong. Instead, something like window()->setGeometry(QHighDpi::fromNativePixels(geometry(), window())) should be called.

      Patches for Qt 5.12.10, 5.14.2, 5.15.2 are attached.

        Attachments

        1. qcocoawindow.5.12.10.patch
          0.5 kB
          Jan Patera
        2. qcocoawindow.5.14.2.patch
          0.5 kB
          Jan Patera
        3. qcocoawindow.5.15.2.patch
          0.5 kB
          Jan Patera
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            jan.patera Jan Patera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes