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

Wayland: Submenu popup in the wrong place instead of adjacent to its parent menu.

    XMLWordPrintable

Details

    • Linux/Wayland
    • d49fab406 (dev)

    Description

      If this toplevel menu has submenus, those submenus can be opened by just moving the mouse into the toplevel menu but this is shown at some random position. It seems submenu is not placed relative to its parent menu. 

      Most likely this is happening because Qt code fails to define the submenu surface as a "popup" and therefore the submenu surface misses the anchor information.

      Looking at source the condition for defining the "popup" is in the constructor
      QWaylandXdgSurface::QWaylandXdgSurface:

      } else if (type == Qt::Popup && transientParent && display->lastInputDevice()) {
      setGrabPopup(transientParent, display->lastInputDevice(), display->lastInputSerial());

      The "lastInputDevice()" is a nullptr when the bad observation occurs.

      looks like  "setLastInputDevice" was only placed in following places, perhaps it is needed to be added at other place too.

      • QWaylandInputDevice::Pointer::pointer_button()
      • QWaylandInputDevice::Keyboard::keyboard_key()
      • QWaylandInputDevice::Touch::touch_down()

      Steps to reproduce with attached tiny example:

      qmake
      make
      weston &
      export WAYLAND_DISPLAY=wayland-0
      ./menu

      1. Wait ~5sec for menu to appear somewhere
      2. Hover over menu's submenu entry
      3. BAD: submenu opens somewhere
      4. Click on some menu entry above the submenu entry
      5. Hover back to the submenu entry
      6. OK: the submenu now opens adjacent to the toplevel menu

       

      Attachments

        For Gerrit Dashboard: QTBUG-128937
        # Subject Branch Project Status CR V

        Activity

          People

            tvete Paul Olav Tvete
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes