nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

click event on tray does not work

Open echoma opened this issue 5 years ago • 6 comments

NWJS Version : 0.34.5 Operating System : Windows 10

Expected behavior

Click on tray icon, the click-event-callback should be invoked.

Actual behavior

the callback is not invoked.

How to reproduce

It doesn't happen certainly, but it happens frequently. I don't find a way to reproduce this issue.

Sometimes it happens rightly after app starting up. Sometimes you must wait a long time before it happens again.

Other infomation

The main page is not navigated.

When this happens, the tooltip and icon of the tray can be updated, so I am sure that the tray is not GCed,

When this happens, I try to remove current tray, and create a new tray, but still, the callback is not invoked.

When this happens, chrome.runtime.reload() should make the app re-initialize the tray, but still, the callback is not invoked.

echoma avatar Dec 03 '18 05:12 echoma

Could you please provide a minimal sample to reproduce it?

rogerwang avatar Dec 03 '18 05:12 rogerwang

@rogerwang Now I know what causes this issue. My app will call chrome.runtime.reload() in some situation automaticaly. After reload, the tray's click event callback is broken, but you can still update the icon and tooltip of the tray.

I make a sample to reproduce it. you can download it through this page. Note: this file will expire after 24 hours. You can click the buttons at the bottom of this APP to reproduce this issue.

echoma avatar Dec 03 '18 09:12 echoma

I've created a simplified version to reproduce the issue.

Tray-Bug-Example.zip

Note that if you remove the tray prior to causing a refresh this issue is prevented.

TheJaredWilcurt avatar Dec 03 '18 21:12 TheJaredWilcurt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 29 '19 00:11 stale[bot]

I'am facing the same problem here, did anybody have a look into it?

Wen I click on the tray menu nothing happens, I have tried in Ubuntu 19.10 and Windows 10

GuiUzeda avatar Apr 20 '20 03:04 GuiUzeda

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 10:01 stale[bot]

I have the same problem, is there a solution for this issue? In my case, I use MacOS.

helderk avatar Dec 21 '22 15:12 helderk