Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.6
-
-
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
- Wait ~5sec for menu to appear somewhere
- Hover over menu's submenu entry
- BAD: submenu opens somewhere
- Click on some menu entry above the submenu entry
- Hover back to the submenu entry
- OK: the submenu now opens adjacent to the toplevel menu