Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring the window to foreground on notification #832

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
chylek committed Mar 23, 2018
commit 96c378bd0fc8112691010d00b913dead37293d3a
6 changes: 3 additions & 3 deletions src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ export default class AppStore extends Store {

if (options.bringToForeground) {
// focus the service from the notification
this.actions.service.setActive({serviceId});
this.actions.service.setActive({ serviceId });

// show window but do not steal focus
const mainWindow = remote.getCurrentWindow();
mainWindow.showInactive();
// show on top of others until focused
if (!mainWindow.isAlwaysOnTop()) {
mainWindow.setAlwaysOnTop(true);
mainWindow.once("focus", () => {
mainWindow.once('focus', () => {
mainWindow.setAlwaysOnTop(false);
})
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/stores/ServicesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export default class ServicesStore extends Store {
silent: true,
});
}
if (service.isNotificationBringsToForegroundEnabled){
if (service.isNotificationBringsToForegroundEnabled) {
Object.assign(options, {
bringToForeground: true,
});
Expand Down