Skip to content

Commit

Permalink
Merge pull request #10097 from vector-im/jryans/linux-icons
Browse files Browse the repository at this point in the history
Fix default Electron window and tray icons
  • Loading branch information
jryans authored Jun 18, 2019
2 parents 8458aa7 + f3bfb08 commit b7a19c6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Binary file modified electron_app/img/riot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion electron_app/src/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion electron_app/src/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@
"electronVersion": "4.2.4",
"files": [
"node_modules/**",
"src/**",
"img/**"
"src/**"
],
"extraResources": [
{ "from": "electron_app/img", "to": "img" },
"webapp/**/*",
"origin_migrator/**/*"
],
Expand Down

0 comments on commit b7a19c6

Please sign in to comment.