Skip to content

[Bug]: tray tooltip not working on linux #28131

Closed

Description

@hovancik

Preflight Checklist

Electron Version

12

What operating system are you using?

Ubuntu

Operating System Version

20.04

What arch are you using?

x64

Last Known Working Electron version

2

Expected Behavior

Tray tooltip is visible with the text I specified.

Actual Behavior

Tray tooltip specified is not visible.

Testcase Gist URL

https://github.com/hovancik/electron-tooltip-bug

Additional Information

I had to recreate this from #15161 that was closed by your friendly bot.

Activity

  1. added
    bug/regression ↩️
    on Mar 11, 2021
  2. soloturn commented on Apr 18, 2021

    @soloturn

    there are linux systems which do not have a tray, gnome one of them, see their reasoning here:
    https://blogs.gnome.org/aday/2017/08/31/status-icons-and-gnome/

    it would be great that electron has a way that a client app can check programmatically "if a tray exists then *.

  3. geekCyberWarrior commented on Jul 25, 2021

    @geekCyberWarrior

    The same issue still persists where the tooltip shown is "electron" irrespective of what is set

    • Kali Linux 2021.2 x64
    • KDE Plasma Version: 5.20.5
    • Electron 13.1.7
  4. Nantris commented on Feb 17, 2022

    @Nantris
    Contributor

    Seeing the same issue. I believe this is a KDE-specific issue, but I hope the maintainers will see fit to address it as KDE is increasingly popular (with good reason.)


    Expected Behavior

    trayIcon.setToolTip('hello') should result in the tooltip reading "hello."

    Actual Behavior

    The tooltip reads as the app's title in packaged application, all lowercase, and cannot be changed.

    In development, tooltip is locked to "electron".


    @hovancik can you share what desktop environment you're using? I'm guessing KDE.

  5. ReazerDev commented on Apr 15, 2022

    @ReazerDev

    Can confirm. I have the same issue with KDE.

  6. Adamcake commented on May 4, 2022

    @Adamcake

    I've just come across this too, looks to be KDE-specific. The tooltip always says "electron" regardless of what's passed to setToolTip. Reproducible in a fresh project using latest Electron version (18.2.0). This has been open for over a year now, is a fix incoming any time soon?

    (PS: I'm using KDE/Plasma in Void Linux)

    Edit to add: BrowserWindow's skipTaskbar setting also does not work.

  7. cuikho210 commented on Jul 29, 2022

    @cuikho210

    I am also getting the same error on Manjaro KDE, [email protected].
    setToolTip not working and the tooltip always shows 'electron'.

  8. viztheman commented on Sep 4, 2022

    @viztheman

    It's not just KDE. I'm running XFCE on Mint Vanessa, and I'm seeing the same thing (i.e. tooltips only say "electron" when you hover over them).

  9. SpacingBat3 commented on Sep 4, 2022

    @SpacingBat3

    It seems to be a bug with libappindicator, GtkStatusIcon works fine (at least on XFCE).

    I think Electron should refresh their implementation on libappindicator, many native apps can actually handle mouse clicks with it and update the tooltip so I don't know why it is there a limitation.

    The tooltip reads as the app's title in packaged application, all lowercase, and cannot be changed.

    It seems to be an actual binary/process name, so if it is lowercase, it will be displayed as such as well. In development, it defaults to electron as it is the default binary name.

    This has been open for over a year now, is a fix incoming any time soon?

    There's a lot to improve in Electron according to Linux integrations (e.g. buttons with notifications, as libnotify supports that) and for many not the slightest improvement were done (so until we won't see any interest from the Electron developers and they at least confirm it is reproducible on their side, it's probably not going to be fixed by the team). However, some can still be workaround-ed for the existing Electron builds, maybe even this one could be with the magic of native modules.

  10. Nantris commented on Sep 5, 2022

    @Nantris
    Contributor

    However, some can still be workaround-ed for the existing Electron builds, maybe even this one could be with the magic of native modules.

    I don't think this can or should be fixed that way. The Electron team should investigate and fix this as the community has certainly provided enough details now. Linux is an increasingly popular platform and developers using Electron expect parity in feature set except where otherwise noted in the docs, and this is not otherwise noted.

    Is there anyone else besides @viztheman seeing this on XFCE?

    @SpacingBat3 @viztheman If we could figure out how/under what circumstances this affects XFCE I think we'd be in a situation where we are able to present the Electron devs with all the details necessary for a productive investigation. I thought we were already at that point, but that XFCE is also affected in some situations is news to me. (That's not to say they will investigate it, but at least the community will have done its part.)

  11. SpacingBat3 commented on Sep 5, 2022

    @SpacingBat3

    If we could figure out how/under what circumstances this affects XFCE I think we'd be in a situation where we are able to present the Electron devs with all the details necessary for a productive investigation.

    @slapbox I don't think this issue is dependant on any distribution, but on which library Electron is using to provide the tray indicators. AFAIK GNOME can even display libappindicator with the extensions and I suspect this bug would be reproducible with that as well. If it would be a bug specific to the any distribution, it would mean that something wrong is actually with the libappindicator plugin/applet (or whatever you call that section on your panel) implementations and would likely be reproduceable with non-Electron software as well.

    However, a lot of software not only display a custom tooltip and change it at runtime but also is capable of styling it, probably using XML/HTML tags as AFAIK this is supported by either libappindicator applets or generally by desktop environments (GTK actually is capable of using these tags as well in some places). I think styled tooltip might even work with GtkStatusIcon and maybe even actually in Electron, but I would have to test this one.

    And there's no circumstances on which this issue occurs. tray.setToolTip just doesn't work with libappindicator and there's no way to modify tooltip at runtime (or create a tray with the custom tooltip, Electron just doesn't support any other way for setting a tooltip than at runtime), you can only modify it by renaming Electron's ELF executable to something else (so I suspect it is taken from the process name before initializing the tray). However, GtkStatusIcon which is being used as a fallback when libappindicator is missing works correctly and even supports the click action as noted in Electron docs.

    I don't think this can or should be fixed that way.

    I think the one could just use the libappindicator (native library) with the Node native modules to provide a tray entry, but that would be something both hard to maintain and integrate with Electron, so definitely that shouldn't be fixed that way if Electron devs can do this easier and in more productive way.

  12. viztheman commented on Sep 6, 2022

    @viztheman

    Can confirm it's still reproducible in my XFCE environment FWIW. Oddly enough, now that I'm installing DPKGs through Electron Forge instead of directly running it, I'm getting the project name as the tooltip (in this case, "Pill-tracker") instead of "Electron." I checked my packages and libappindicator is installed. I don't see GtkStatusIcon installed unless that's a component buried in the guts of Gnome somewhere.

    Can also confirm the above behavior happens in Cinnamon. Again, this is Mint 21 Vanessa if that makes any difference.

  13. Nantris commented on Oct 28, 2022

    @Nantris
    Contributor

    Installing libappindicator3-1 does not fix this issue, although it does fix #22207.

    @nornagon I wonder if there's anything the Electron team can do on their end? I had hoped that a newer libappindicator would fix both issues, but the fact it doesn't fix this one makes me think it's a limitation on the Electron side.

  14. Adamcake commented on Oct 29, 2022

    @Adamcake

    Installing libappindicator3-1 does not fix this issue,

    IMO, even if there is something you can install that makes this feature work, there shouldn't be. System trays are defined entirely via X props - which means this is no more difficult than setting a window title. If Electron can't just set a few properties and instead assumes some random dependency will be installed to handle this, then it is wildly over-complicating its job.

  15. hovancik commented on Dec 20, 2022

    @hovancik
    Author

    Seems to work fine :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    12-x-ybug 🪲bug/regression ↩️platform/linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions