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

Context menu of QML SystemTrayIcon popup position is wrong with KDE + Flatpak

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      There seems to be some kind of difference between using the widget based QSystemTrayIcon implementation directly and the QML labs implementation when it comes to Flatpaks. I'm not 100% sure if this is a Qt issue, but all signs point there in the moment.

      Works:

      Package the Systray example application as a flatpak and install it. The systray icon is shown and the context menu is in place. Both work, inside a flatpak and directly on the system.

      Fails:

      Use the attached QML example pasted right from the docs as a flatpak (instructions are in README.md if required). The systray icon is shown, but the context menu initially pops up as a window of it's own:

      What might help understanding this issue is the fact that using QGuiApplication instead of QApplication (not recommended in the docs) leads to a

      QWidget: Cannot create a QWidget without QApplication
      

      message, while this message does not pop up when starting the same application as non flatpak directly on the system. So it works when not being deployed as a flatpak.

      Another thing to note is that if I override the desktop environment using

      --env=XDG_CURRENT_DESKTOP=gnome
      

      the flatpak works, too. Independently of using QApplication or QGuiApplication.

      The host system is running Fedora 40 / KDE Plasma 6.

      Attachments

        1. image-2024-06-10-07-43-26-079.png
          image-2024-06-10-07-43-26-079.png
          5.08 MB
        2. labstray.tgz
          4 kB
        3. list.txt.xz
          332 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes