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

Broken menu/combo dropdown positioning in multiple monitor setup when running under wine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.3.2
    • QPA: Windows
    • Qt5 for Windows running under wine on any Linux distribution

    Description

      Due to a bug in wine's implementation of GetMonitorInfo (which returns the same hardcoded string for every monitor), Qt doesn't correctly detect the available monitors (it keeps only the last enumerated one).

      This results in broken QDesktopWidget::screenNumber, which in turn breaks the positioning of (at least) menus and combo boxes dropdowns, which are snapped to the last enumerated screen (see attached images).

      This is a confirmed bug in wine (https://bugs.winehq.org/show_bug.cgi?id=37709), but doesn't seem so immediate to fix (the changes are not very localized); since we need to run a custom Win32 application on wine while migrating it to Qt, I wrote a patch that adds a workaround in the Qt platform plugin for Windows.

      The patch adds an "id" member to QWindowsScreenData, which is used as the search key in QWindowsScreenManager::m_screens. If everything is normal, id is just a copy of name (which is left untouched); but if multiple screens with the same name are detected after enumeration, ids are rewritten to make them unique.

      This should fix most problems (the multiple monitors are correctly detected), without touching the data stored in the external interface (in particular, the name is left untouched) and without any change in behavior in the "regular" case (=running under "real" Windows with non-duplicated device names).

      Attachments

        1. cross screen-broken 1.png
          cross screen-broken 1.png
          11 kB
        2. cross screen-broken 2.png
          cross screen-broken 2.png
          18 kB
        3. monitor54.diff
          4 kB
        4. qtbug43439.zip
          2 kB
        5. wine-displays.patch
          0.7 kB
        6. wine-displays.patch
          4 kB
        7. wine-displays.patch
          4 kB
        For Gerrit Dashboard: QTBUG-43439
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            mitalia Matteo Italia
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes