Improved windows notifications

This commit is contained in:
Scott Nonnenberg 2023-08-01 09:06:29 -07:00 committed by GitHub
parent 584e39d569
commit 40c21b1666
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 1227 additions and 151 deletions

View file

@ -174,7 +174,7 @@ export class SystemTrayService {
);
if (this.browserWindow) {
this.browserWindow.show();
forceOnTop(this.browserWindow);
focusAndForceToTop(this.browserWindow);
}
},
}),
@ -223,7 +223,7 @@ export class SystemTrayService {
browserWindow.hide();
} else {
browserWindow.show();
forceOnTop(browserWindow);
focusAndForceToTop(browserWindow);
}
});
@ -269,7 +269,7 @@ function getDefaultIcon(): NativeImage {
return defaultIcon;
}
function forceOnTop(browserWindow: BrowserWindow) {
export function focusAndForceToTop(browserWindow: BrowserWindow): void {
// On some versions of GNOME the window may not be on top when restored.
// This trick should fix it.
// Thanks to: https://github.com/Enrico204/Whatsapp-Desktop/commit/6b0dc86b64e481b455f8fce9b4d797e86d000dc1