summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-09-09 21:01:57 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-09-09 21:01:57 +0200
commit021e1754fec768e3ba56e67a93d919e83f09ae64 (patch)
tree1732db17407bc0ced5a2723c89ea860bed251fb4
parent8c7653b4f16d48d39154b149f9c49a0be5209caa (diff)
downloadmullvadvpn-021e1754fec768e3ba56e67a93d919e83f09ae64.tar.xz
mullvadvpn-021e1754fec768e3ba56e67a93d919e83f09ae64.zip
Move window related ipc calls to same group in schema
-rw-r--r--gui/src/main/index.ts4
-rw-r--r--gui/src/main/window-controller.ts2
-rw-r--r--gui/src/renderer/app.tsx4
-rw-r--r--gui/src/shared/ipc-schema.ts8
4 files changed, 8 insertions, 10 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 8fa09576c7..fc9170bf24 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -1032,7 +1032,7 @@ class ApplicationMain {
private registerWindowListener(windowController: WindowController) {
windowController.window?.on('focus', () => {
- IpcMainEventChannel.windowFocus.notify(windowController.webContents, true);
+ IpcMainEventChannel.window.notifyFocus(windowController.webContents, true);
this.blurNavigationResetScheduler.cancel();
@@ -1049,7 +1049,7 @@ class ApplicationMain {
});
windowController.window?.on('blur', () => {
- IpcMainEventChannel.windowFocus.notify(windowController.webContents, false);
+ IpcMainEventChannel.window.notifyFocus(windowController.webContents, false);
// ensure notification guard is reset
this.notificationController.resetTunnelStateAnnouncements();
diff --git a/gui/src/main/window-controller.ts b/gui/src/main/window-controller.ts
index 50ceab01e4..298f767fb5 100644
--- a/gui/src/main/window-controller.ts
+++ b/gui/src/main/window-controller.ts
@@ -230,7 +230,7 @@ export default class WindowController {
if (this.window) {
const shapeParameters = this.windowPositioning.getWindowShapeParameters(this.window);
- IpcMainEventChannel.windowShape.notify(this.webContentsValue, shapeParameters);
+ IpcMainEventChannel.window.notifyShape(this.webContentsValue, shapeParameters);
}
}
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index 3f65002340..851a37a591 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -132,7 +132,7 @@ export default class AppRenderer {
log.addOutput(new ConsoleOutput(LogLevel.debug));
log.addOutput(new IpcOutput(LogLevel.debug));
- IpcRendererEventChannel.windowShape.listen((windowShapeParams) => {
+ IpcRendererEventChannel.window.listenShape((windowShapeParams) => {
if (typeof windowShapeParams.arrowPosition === 'number') {
this.reduxActions.userInterface.updateWindowArrowPosition(windowShapeParams.arrowPosition);
}
@@ -199,7 +199,7 @@ export default class AppRenderer {
this.reduxActions.settings.setSplitTunnelingApplications(applications);
});
- IpcRendererEventChannel.windowFocus.listen((focus: boolean) => {
+ IpcRendererEventChannel.window.listenFocus((focus: boolean) => {
this.reduxActions.userInterface.setWindowFocused(focus);
});
diff --git a/gui/src/shared/ipc-schema.ts b/gui/src/shared/ipc-schema.ts
index a20213f424..32f1344bfd 100644
--- a/gui/src/shared/ipc-schema.ts
+++ b/gui/src/shared/ipc-schema.ts
@@ -98,11 +98,9 @@ export const ipcSchema = {
state: {
get: invokeSync<void, IAppStateSnapshot>(),
},
- windowShape: {
- '': notifyRenderer<IWindowShapeParameters>(),
- },
- windowFocus: {
- '': notifyRenderer<boolean>(),
+ window: {
+ shape: notifyRenderer<IWindowShapeParameters>(),
+ focus: notifyRenderer<boolean>(),
},
navigation: {
reset: notifyRenderer<void>(),