Search code examples
javascriptnode-webkitnw.js

NW.js loosing transparent after OS hibernation


I am working on an App for windows, with Node webkit version: '0.17.4'. I just figured out that the transparency was disabled after each hibernation wake up + app restoration fromm system tray.

win.on('minimize', function () {
    var tray = new gui.Tray({title: 'Ephemeride', icon: 'images/icon.png'});
    // Hide window
    win.hide();
    // Show window and remove tray when clicked
    tray.on('click', function () {
        win.show();
    });
});

win.on('restore', function () {
    win.resizeTo(900, 600);

});

Any ideas ?
Thanks


Solution

  • Finaly a find this solution, to reload chrome runtime.

    var tray;
    win.on('minimize', function () {
        tray = new gui.Tray({title: 'Ephemeride', icon: 'images/mini-icon.png'});
    
        // Hide window
        win.hide();
        // Show window and remove tray when clicked
        tray.on('click', function () {
            win.show();
            tray.remove();
            chrome.runtime.reload();
        });
    });
    
    win.on('restore', function () {
        win.resizeTo(900, 600);
    });
    

    Hope this will help.