Skip to content

Commit

Permalink
3.6.6 remove global Escape key registering, interfiered other app nor…
Browse files Browse the repository at this point in the history
…mal behaviours. Registered Escape key locally instead. So user can exit fullscreen with that.
  • Loading branch information
MayGo committed Feb 6, 2020
1 parent f2c05ad commit b1ab1c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
9 changes: 9 additions & 0 deletions electron/app/menu-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ export default class MenuBuilder {
{ role: 'zoomout' },
{ type: 'separator' },
{ role: 'togglefullscreen' },
{
label: 'Exit fullscreen',
accelerator: 'Escape',
click() {
if (WindowManager.mainWindow) {
WindowManager.mainWindow.setFullScreen(false);
}
},
},
],
},
{
Expand Down
14 changes: 1 addition & 13 deletions electron/app/window-manager.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { menubar } from 'menubar';
import MenuBuilder from './menu-builder';
import { throttle } from 'lodash';
import { app, ipcMain, BrowserWindow, globalShortcut } from 'electron';
import { app, ipcMain, BrowserWindow } from 'electron';
import config from './config';
import * as os from 'os';
import { logManager } from './log-manager';
import { join } from 'path';
import { stateManager } from '../app/state-manager';

let logger = logManager.getLogger('WindowManager');

Expand Down Expand Up @@ -77,18 +76,7 @@ export default class WindowManager {
this.mainWindow.focus();
});

globalShortcut.register('Escape', () => {
logger.info('Escape is pressed');

if (this.mainWindow) {
this.mainWindow.setFullScreen(false);
}
});

this.mainWindow.on('close', () => {
// Unregister all shortcuts.
globalShortcut.unregisterAll();

if (this.mainWindow) {
logger.info('Closing window');
this.mainWindow = null;
Expand Down
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tockler",
"version": "3.6.5",
"version": "3.6.6",
"description": "Automatically track applications usage and working time",
"author": "Maigo Erit <[email protected]>",
"license": "GPL-2.0",
Expand Down

0 comments on commit b1ab1c7

Please sign in to comment.