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

Qt5 QMenu will get hidden instantly after showing when running with QT_QPA_PLATFORM=xcb under XWayland

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 5.15.10
    • QPA: X11/XCB
    • Linux/Wayland, Linux/X11

    Description

      Affected version

      • Fedora 38
      • Mutter 44.3
      • Issue does not appear under Xorg or when starting application with `QT_QPA_PLATFORM=wayland`
      • Qt 5.15.10

      Bug summary

      When running a Qt App with the `QT_QPA_PLATFORM` environment variable set to `xcb` QMenus sometimes get closed "instantly" after showing. This results in context menus being unusable in the application.

      Steps to reproduce

      This can be seen in Mixxx: https://github.com/mixxxdj/mixxx/issues/11576
      Alternatively it's also trivially reproduced in a demo application (see demo.zip )

      Right-clicking the "rightclick me" label will only flash the qmenu since its being hidden so shortly afterwards again (can be seen by setting a breakpoint in `QMenu::hideEvent`).
      A similar issue can be seen when using the Menubar QMenu, sometimes staying closed after a click.

      What happened

      The Menu randomly doesn't not show up. As debugging reveals, because its hidden shortly after spawning it.

      What did you expect to happen

      The menu should've shown up on every click.

      Relevant logs, screenshots, screencasts etc.

      The xcb recording shows the faulty behavior while the wayland recording shows the correct one.
      xcb.webm
      wayland.webm

      Attachments

        1. demo.zip
          1 kB
        2. wayland.webm
          182 kB
        3. xcb.webm
          862 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            swiftb0y Nikolaus Einhauser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes