Skip to content

Commit

Permalink
fix: fullscreen break escape key issue
Browse files Browse the repository at this point in the history
  • Loading branch information
roldanjr authored and sekwah41 committed Dec 20, 2022
1 parent 3cb1725 commit b4affbb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/main/src/lifecycleEventHandlers/fullScreenBreak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const setFullScreen = (
flag: boolean,
alwaysOnTop: boolean,
win: BrowserWindow | null,
fullscreenState: FullscreenState,
fullscreenState: FullscreenState
) => {
win?.setFullScreenable(true);
win?.setAlwaysOnTop(alwaysOnTop, "screen-saver");
Expand All @@ -45,25 +45,23 @@ const setFullScreen = (
*/
export const setFullscreenBreakHandler = (
fullscreenArgs: FullscreenArgs,
appArgs: AppArgs,
appArgs: AppArgs
) => {
const { shouldFullscreen, alwaysOnTop } = fullscreenArgs;
const { tray, trayTooltip, win, contextMenu, fullscreenState } = appArgs;

if (shouldFullscreen) {
setFullScreen(true, alwaysOnTop, win, fullscreenState);

activateFullScreenShortcuts(() => {
setFullScreen(false, alwaysOnTop, win, fullscreenState);
});
activateFullScreenShortcuts(() => {});

tray?.setToolTip("");
tray?.setContextMenu(
Menu.buildFromTemplate([
{
label: "Please wait for your break to end.",
},
]),
])
);
} else {
setFullScreen(false, alwaysOnTop, win, fullscreenState);
Expand Down

0 comments on commit b4affbb

Please sign in to comment.