Skip to content

Commit

Permalink
Fix Always on Top after tray toggling on KDE Plasma (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
MHekert authored and sindresorhus committed Oct 31, 2019
1 parent 89911d5 commit 2b2be20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ Press Command/Ctrl+R in Caprine to see your changes.
},
{
label: 'Always on Top',
id: 'always-on-top',
type: 'checkbox',
accelerator: 'CommandOrControl+Shift+T',
checked: config.get('alwaysOnTop'),
Expand Down
5 changes: 5 additions & 0 deletions source/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export default {
win.hide();
} else {
win.show();

// Workaround for https://github.com/electron/electron/issues/20858
// `setAlwaysOnTop` stops working after hiding the window on KDE Plasma.
const alwaysOnTopMenuItem = Menu.getApplicationMenu()!.getMenuItemById('always-on-top');
win.setAlwaysOnTop(alwaysOnTopMenuItem.checked);
}
}

Expand Down

0 comments on commit 2b2be20

Please sign in to comment.