nw.js: Custom icon in taskbar not showing with 0.73.0 - grey default icon only
The custom icon in the windows 11’s taskbar is a grey default icon, with 0.73.0-sdk (or ‘normal’ non-sdk). It works flawlessly with 0.72.0 (and previous).
The odd thing with 0.73.0 is that the icon in the top-left corner (favico equivalent?) is there. The icon also is present in Task Manager (for the binary and all sub-processes spawned by nwjs too). And the icon also is fine with the Tray. But not on the main taskbar.
FYI: Disabling/enabling nw2
doesnt change the icon issue.
Attached: a printscreen of the nwjs icon (right) and the devtools icon (left). They used to both be my custom icon.
- Operating System: Windows 11 x64
- NW.js Version: 0.73.0 (sdk/normal)
- Code snippet:
In
package.json
:
"window": {
"width": 1024,
"height": 654,
"title": "My App",
"icon": "foo/bar.png",
"min_width": 885,
"min_height": 518,
"show": false
},
in the js files after some background checks for the app to prepare to strat:
require('nw.gui').Window.get().show(true)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 6
- Comments: 42 (11 by maintainers)
Commits related to this issue
- revert to nwjs@0.72.0 - the custom icon doesnt work - see: https://github.com/nwjs/nw.js/issues/8039 — committed to vankasteelj/frak by vankasteelj a year ago
- update nwjs to 0.75.1 - part of #180 - workaround for https://github.com/nwjs/nw.js/issues/8039 — committed to vankasteelj/frak by vankasteelj a year ago
- Fixes #8039; Grey default icon in taskbar on Windows — committed to nhogle/nw.js by nhogle a year ago
- Fixes #8039; Grey default icon in taskbar on Windows — committed to nwjs/nw.js by nhogle a year ago
- Fixes nwjs#8039; Grey default icon in taskbar on Windows Previous fix was not sufficient. We also need to use the updated Chromium `base::Value` api call, `SetByDottedPath` when manipulating the man... — committed to nhogle/nw.js by nhogle a year ago
- Fixes nwjs#8039; Grey default icon in taskbar on Windows Previous fix was not sufficient. We also need to use the updated Chromium `base::Value` api call, `SetByDottedPath` when manipulating the man... — committed to nwjs/nw.js by nhogle a year ago
It’s obviously not ideal and hopefully the issue can be addressed soon, but the workaround does work for me.
old
new
I started digging into this and I noticed that the .ico file that you see is located here:
%UserProfile%\AppData\Local\<app-name>\User Data\Default\Web Applications\_nwjs_<jibberish>\<app-name>.ico
You can find the Windows .lnk file that points to this icon by:
%UserProfile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts\<some hex id>\<app-name>.lnk
Shortut
tab, and click theChange Icon
button you’ll see the above-mentioned .ico file.I’m guessing it has something to do with which Chromium version we’re using?
I found some other interesting things in the Chromium source code, talking about these
ImplicitAppShortcuts
here: https://chromium.googlesource.com/chromium/src/+/main/docs/windows_shortcut_and_taskbar_handling.mdUPDATE: I dug through the Chromium source, and it looks like Chromium manages its own icon and “Relaunch details” See Chromium source here
The problem is
GetIconFilePath()
tries to find an icon by looking at theicons
property in the chrome extension’s manifest. If there is nothing there, then Chromium will use the default icon. The nw.js code supposedly populates the manifest by copying the icon path from thepackage.json
’s, but for some reason, inv0.73.0
and above, it seems this property doesn’t end up in the nw.js-constructed manifest. I found that if force it by putting this inpackage.json
, then Chromium will copy the icon to theAppData
path as expected:@rogerwang : I believe I have a fix for this issue: in
nw::LoadNWAppAsExtensionHook()
, the call to:should actually be:
I confirmed this by actually getting the source to compile on Windows (no easy feat!), and checking that we are getting an empty
icon_path
, but if we useFindStringByDottedPath
, then we get the expected value from the manifest, and NW.js will tell Chromium what to do with the icon.https://github.com/nwjs/nw.js/blob/25f89d17a8886776e3de62ae2f4a931ed13bf2de/src/browser/nw_extensions_browser_hooks.cc#L289
Would you like me to create a pull request with the changes?
At this point it should be obvious that he doesn’t care. The PR is open for 2 months, it’s one short line of code, but I don’t think it will ever be merged.
@rogerwang please provide an update. This prevents us from updating NW.js in our applications.
This is now officially resolved with release 0.79.1.
0.78 the same bug. 🤬 WTF?!
0.77 the same bug. 🤬
Although the PR was merged, this is still broken with 0.78.1. 😦
@rogerwang : Can you please merge my pull request? Thank you!
0.75 the same bug. Seems nobody cares… ☹️
Hi! I’d like to work on this issue
0.74 the same bug.