Skip to content

Tray icon disappear from Topbar when system goes in stand by #22443

Closed

Description

@p-fusi

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    8.0.0
  • Operating System:
    Ubuntu 18.04.4 LTS x64
  • Last Known Working Electron version:
    7.1.13

Expected Behavior

When the system goes in stand by the Tray icon should stay visible in the Topbar

Actual Behavior

When system goes stand by the Tray icon disappear

To Reproduce

I set the icon and the Menu in main process:

let tray;
const icon = path.join(__dirname, "./icon.png");
const tryMenu = Menu.buildFromTemplate([
  { label: "Reload", role: "reload" },
  { label: "Toggle dev tools", role: "toggleDevTools" }
]);
tray = new Tray(icon);
tray.setContextMenu(tryMenu);

When starting electron everything works fine: the icon (and the menu) is visible in the Topbar.
But if system goes stand by, when I log in again the icon is disappeared.

$ git clone https://github.com/p-fusi/electron-quick-start -b master
$ npm install
$ npm start || electron .

Activity

  1. beltrame commented on Mar 25, 2020

    @beltrame

    This happens with all electron applications, I can confirm with Ubuntu 19.10

  2. felixrieseberg commented on Apr 21, 2020

    @felixrieseberg
    Member

    Interesting tidbit from @sbuschjaeger:

    By random chance, I noticed a similar bugreport which mentions a fix for the telegram desktop app. There seems to be a problem with the icon counter, but the telegram app does not use electron. However, maybe it helps.

  3. vladimiry commented on Apr 27, 2020

    @vladimiry

    The above-referenced issue says it's Gnome related but I face the issue of getting disappeared icon after the suspend mode using Xfce Desktop Environment, happens quite rarely though.

  4. MatMaul commented on May 8, 2020

    @MatMaul

    After reading various bugs, here is my understanding of the problem of the disappearing icon on lock/unlock when using Gnome AppIndicator plugin.

    From what I get, Chromium doesn't re-register the tray after the StatusNotifierWatcher disappears/reappears from the d-bus session on lock/unlock, while it probably should. From what I quickly read the spec doesn't really seem to deal with that, it just says only one StatusNotifierWatcher instance is allowed at any time.

    https://github.com/ubuntu/gnome-shell-extension-appindicator/blob/126cb934c59562e55e6454dece9056e15b8e2221/statusNotifierWatcher.js#L126
    There is a workaround here using introspection, which seems to be what the chromium team is complaining (https://bugs.chromium.org/p/chromium/issues/detail?id=1042098), but I am not sure they understood that they are complaining about a workaround that should not be needed if they correctly watch for StatusNotifierWatcher changes.
    I am interested in your opinion on my interpretation here, before I bump the chromium bug with a link to this post :)

    From my point of view, the best upstream fix Gnome-side would be that the StatusNotifierWatcher is not handle by the gnome-shell plugin, but by some other process, so it doesn't depend on Gnome plugins lifecycle. Then the gnome plugin can register itself as a StatusNotifierHost.

    Thought on using something similar to https://github.com/zulip/zulip-desktop/pull/922/files in the meantime ?

  5. Thatoo commented on May 16, 2020

    @Thatoo

    Same on Debian Buster (10).
    Experimented about Riot-desktop : element-hq/element-web#13692

  6. vladimiry commented on May 26, 2020

    @vladimiry

    It turned out Electron is getting rid of DBus related tray icon implementation rolled out with @chromium update in Electron v8 in favor of previously used / GTK/appindicator approach, see #23674.

  7. codebytere commented on Jun 4, 2020

    @codebytere
    Member

    Closed by #23674

  8. added a commit that references this issue on Mar 29, 2021
  9. added a commit that references this issue on Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions