Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSystemTrayIcon does not show up under VNC session
QtWS25 Last Chance

QSystemTrayIcon does not show up under VNC session

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 647 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daria_is
    wrote on last edited by
    #1

    Hi experts, need your help.

    The following code works perfectly directly on PC, but under VNC session the tray icon does not show up.
    Tried Ubuntu 20.04 and Ubuntu 22.04. Using tigervnc-standalone-server.

      QSystemTrayIcon* m_trayIcon = new QSystemTrayIcon(this);
      m_trayIcon->setIcon(QIcon(":/images/trayicon.svg"));
      m_trayIcon->setToolTip(tr("SSM"));
      m_trayIcon->show();
    

    Any suggestions are very valuable. Thanks.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      I am assuming you using VNC to view the Ubuntu machines.

      Is the Xvnc session starting a desktop that has a system tray? No tray, no tray icon.

      Is there space for an icon, but no icon? Have you deployed the Qt SVG graphics plugin?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        daria_is
        wrote on last edited by
        #3

        Yes, of course, the Xvnc session desktop has a system tray.
        The desktop looks exactly as when working directly on a machine.
        Yes, there is a space for the icon in a system tray.

        Yes, the Qt I'm using has a Qt SVG plugin. Also tray icon appear in NoMachine sessions and when running directly on the PC.

        I found following logs in system journal when starting the application:

        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x55f4ebb3fef0] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x55f4ea784610] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x55f4ebb434d0] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x55f4ebb3f710] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x55f4ea784610] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x55f4ebb434d0] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x55f4ebb3f710] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x55f4ea784610] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x55f4ebb434d0] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x55f4ebb3f710] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x55f4ea784610] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x55f4ebb434d0] is on because it needs an allocation.
        gnome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x55f4ebb3f710] is on because it needs an allocation.
        nome-shell[2528]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x55f4ea784610] is on because it needs an allocation.
        
        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Does the tool tip text appear when you hover over the blank space where the icon should be?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            daria_is
            wrote on last edited by daria_is
            #5

            No, the tray behaves like there are no transparent icons

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              Does the System Tray Icon Example fail in the same way?

              1 Reply Last reply
              0
              • D Offline
                D Offline
                daria_is
                wrote on last edited by daria_is
                #7

                Seeing an error window "I couldn't detect any system tray on this system."
                Screenshot.jpg

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved