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

QMenu can appear on wrong display in macOS when menu is taller than half the screen's height

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9.0 Alpha
    • 5.5.1, 5.6.1, 5.7.1
    • None
    • macOS 10.11.6
    • macOS
    • 6af07c57f612072c7c85f3c872941540c31df976

    Description

      When running macOS on a multi-display system, a QPushButton that opens a QMenu may cause the QMenu to appear on the wrong screen.

      In order for this to happen, the menu must be opened on a monitor other than the primary monitor, and the QMenu must have enough items that its height is more than half the height of the current display.

      The attached program demonstrates the bug. (Make sure the menu has enough items to be tall enough.) Run the application, drag the window on to the middle of the secondary monitor, and then click the button. The menu will open in the upper right corner of the primary monitor rather than underneath the mouse cursor.

      Note that if the menu is either near the top or bottom of the secondary monitor such that the menu can open either entirely below or entirely above the button, then the bug will not occur. It only occurs when the menu tries to open so that it covers the button.

      Attachments

        1. main.cpp
          0.5 kB
          Brian Kendall

        Issue Links

          Activity

            People

              wearyinside Oleg Yadrov
              guygizmo Brian Kendall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: