10000 [Bug]: tray icon disappears after several seconds even if I declare `tray` to be global. · Issue #31564 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Bug]: tray icon disappears after several seconds even if I declare tray to be global. #31564
Closed
@YongzeYao

Description

@YongzeYao

Preflight Checklist

Electron Version

15.3.0

What operating system are you using?

macOS

Operating System Version

macOS Big Sur 11.6

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

Tray Icon would stay in the tray.

Actual Behavior

Tray Icon disappears after several seconds.

Testcase Gist URL

No response

Additional Information

const { app, Tray, nativeImage } = require('electron');
const path = require('path');

let tray = null;

app.whenReady().then(() => {
  const icon = nativeImage.createFromPath(
    path.join(__dirname, './assets/icon.png')
  );
  tray = new Tray('src/assets/icon.png');
  tray.setTitle('Attention App');
});

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0