Merge pull request #10097 from vector-im/jryans/linux-icons

Fix default Electron window and tray icons
pull/10124/head
J. Ryan Stinnett 2019-06-18 17:35:34 +01:00 committed by GitHub
commit b7a19c6d16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -295,7 +295,10 @@ app.on('ready', () => {
console.log('No update_base_url is defined: auto update is disabled');
}
const iconPath = `${__dirname}/../img/riot.${process.platform === 'win32' ? 'ico' : 'png'}`;
// It's important to call `path.join` so we don't end up with the packaged
// asar in the final path.
const iconFile = `riot.${process.platform === 'win32' ? 'ico' : 'png'}`;
const iconPath = path.join(__dirname, "..", "..", "img", iconFile);
// Load the previous window state with fallback to defaults
const mainWindowState = windowStateKeeper({

View File

@ -65,7 +65,7 @@ exports.create = function(config) {
global.mainWindow.webContents.on('page-favicon-updated', async function(ev, favicons) {
if (!favicons || favicons.length <= 0 || !favicons[0].startsWith('data:')) {
if (lastFavicon !== null) {
win.setIcon(defaultIcon);
global.mainWindow.setIcon(defaultIcon);
trayIcon.setImage(defaultIcon);
lastFavicon = null;
}

View File

@ -156,10 +156,10 @@
"electronVersion": "4.2.4",
"files": [
"node_modules/**",
"src/**",
"img/**"
"src/**"
],
"extraResources": [
{ "from": "electron_app/img", "to": "img" },
"webapp/**/*",
"origin_migrator/**/*"
],