From 753b06a7a82211394ac3d03a9303760230239e71 Mon Sep 17 00:00:00 2001 From: 4gray <4gray@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:39:24 +0100 Subject: [PATCH] fix: shortcut to close the app --- electron/main.ts | 14 +------------- electron/menu.ts | 1 + 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/electron/main.ts b/electron/main.ts index ea8ac697a..8e0d868cb 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -1,5 +1,5 @@ /* eslint-disable no-useless-catch */ -import { app, BrowserWindow, globalShortcut, Menu } from 'electron'; +import { app, BrowserWindow, Menu } from 'electron'; import * as path from 'path'; import * as url from 'url'; import { Api } from './api'; @@ -78,21 +78,9 @@ function createWindow(): BrowserWindow { } }); - registerGlobalShortcuts(); return win; } -/** - * Registers common keyboard shortcuts - */ -function registerGlobalShortcuts() { - if (process.platform === 'darwin') { - globalShortcut.register('Command+Q', () => { - app.quit(); - }); - } -} - /** * Creates hidden window for EPG worker * Hidden window is used as an additional thread to avoid blocking of the UI by long operations diff --git a/electron/menu.ts b/electron/menu.ts index 1ff76235c..519e88386 100644 --- a/electron/menu.ts +++ b/electron/menu.ts @@ -72,6 +72,7 @@ export class AppMenu { { label: 'Exit', click: () => app.quit(), + accelerator: 'CmdOrCtrl+Q', }, ], });