Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NW.js icon on the taskbar when you open a tray menu #6859

Closed
lyaskovec opened this issue Nov 7, 2018 · 10 comments
Closed

NW.js icon on the taskbar when you open a tray menu #6859

lyaskovec opened this issue Nov 7, 2018 · 10 comments

Comments

@lyaskovec
Copy link

lyaskovec commented Nov 7, 2018

NW.js Version: sdk-v0.34.1
Operating System: Windows 10 x64, Windows 7 x64

How to reproduce

You can use the code for create simple tray object and hide main window:

let menu = new nw.Menu();
let path = require("path");
// Test icon for tray object
let icon = path.resolve(path.dirname(process.execPath), "icon.png");
menu.append(new nw.MenuItem({ label: 'Item A' }));
menu.append(new nw.MenuItem({ label: 'Item B' }));
new nw.Tray({title: "Test title", icon, menu});
// Hide main window
nw.Window.get().hide();

After this, if you open tray context menu, nwjs icon show on thw windows taskbar:
https://youtu.be/8CHHSMFjsGk

@TheJaredWilcurt
Copy link
Member

Confirmed that issue only occurs in 0.34.0-beta and above. Issue not present in 0.33.4 or below.

Reproduction package.nw folder attached:

@shaynem
Copy link

shaynem commented Mar 29, 2019

Any update on this - it's much worse in Windows 7 as it shows not just the small ICON as it does in Windows 10.

Screen Shot 2019-03-30 at 2 10 21 am

@weiluenju
Copy link

Same issue at 0.37.3

@ffanny
Copy link
Member

ffanny commented Apr 11, 2019

I can reproduce this with v0.34 & later version.

@thuraucsy
Copy link

Confirmed the issue and it is still happening in the latest version [nwjs-sdk-v0.39.0-win-x64].
As @TheJaredWilcurt said, in version 0.33.4 is okay!

@weiluenju
Copy link

One year has passed, v0.42.4 has been released, but the issue still not fix.

@anurag-2911
Copy link

anurag-2911 commented Nov 21, 2019

@rogerwang: Is there a way I can handle this in code? That is on right-click on tray icon I should be able to hide nwjs icon on the taskbar .

@TheJaredWilcurt
Copy link
Member

@anurag2911 the tray feature only supports a native menu on right-click (which causes this bug) and a click event on left-click.

tray.on('click', function (evt) {
  nw.Window.get().showDevTools();
  console.log(evt.x);
  console.log(evt.y);
});

Using the x,y coords, you could spawn a custom frameless window that simulates a menu at that location. Frameless windows with show_in_taskbar: false will not cause this issue. This is of course a hack, but would allow for much greater control over the rendering of the menu.

@TheJaredWilcurt
Copy link
Member

@rogerwang

The diff between the versions is pretty small, could you identify the cause?

tray bug gif

@TheJaredWilcurt TheJaredWilcurt changed the title nwjs icon on the taskbar when you open a tray menu NW.js icon on the taskbar when you open a tray menu Nov 3, 2020
@TheJaredWilcurt
Copy link
Member

I can no longer reproduce this since version 0.48.0, including the latest release (0.55.0). Tested on Windows 7 and Windows 10.

The issue occurred between 0.34 and 0.47. Closing this issue as it is no longer occurring.

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

No branches or pull requests

8 participants