Make clicking notifications focus VC Desktop

This commit is contained in:
Vendicated
2023-04-05 05:19:48 +02:00
parent 2efed86b71
commit cf23b6d028
7 changed files with 36 additions and 7 deletions

11
src/renderer/fixes.ts Normal file
View File

@@ -0,0 +1,11 @@
// Make clicking Notifications focus the window
const originalSetOnClick = Object.getOwnPropertyDescriptor(Notification.prototype, "onclick")!.set!;
Object.defineProperty(Notification.prototype, "onclick", {
set(onClick) {
originalSetOnClick.call(this, function () {
onClick.apply(this, arguments);
VencordDesktop.win.focus();
});
},
configurable: true
});