Skip to content

Commit

Permalink
chore: Revert workaround for electron/electron#26726
Browse files Browse the repository at this point in the history
* fixed with electron/electron#43243

Signed-off-by: eXhumer <[email protected]>
  • Loading branch information
eXhumer committed Aug 16, 2024
1 parent 6b8c75b commit 1a6a004
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ declare const PLAYER_PRELOAD_WEBPACK_ENTRY: string;
declare const PLAYER_WEBPACK_ENTRY: string;

const APP_CONFIG_PATH = join(app.getPath('userData'), 'config.json');
const WM_INITMENU = 0x0116;

let loginWindow: BrowserWindow | null = null;
let mainWindow: BrowserWindow | null = null;
Expand Down Expand Up @@ -63,14 +62,10 @@ const createPlayerWindow = (container: ContentVideoContainer) => {

playerWindow.setAspectRatio(16 / 9);

// Workaround for draggable frameless window in Windows
// https://github.com/electron/electron/issues/24893#issuecomment-1109262719
if (process.platform === 'win32')
playerWindow.hookWindowMessage(WM_INITMENU, () => {
playerWindow.setEnabled(false);
playerWindow.setEnabled(true);
playerCtxMenuPopup(playerWindow);
});
playerWindow.on('system-context-menu', e => {
e.preventDefault();
playerCtxMenuPopup(playerWindow);
})

playerWindow.on('ready-to-show', () => {
playerWindow.webContents.send(IPCChannel.Player.PLAYER_DATA, container, f1tv.ascendon, f1tv.config);
Expand Down Expand Up @@ -191,7 +186,7 @@ app.on('window-all-closed', () => {

try {
accessSync(APP_CONFIG_PATH, constants.F_OK | constants.R_OK);
} catch (e) {
} catch (e) { // eslint-disable-line @typescript-eslint/no-unused-vars
writeFileSync(APP_CONFIG_PATH, JSON.stringify(DefaultAppConfig));
} finally {
const config = JSON.parse(readFileSync(APP_CONFIG_PATH, { encoding: 'utf-8' })) as AppConfig;
Expand Down

0 comments on commit 1a6a004

Please sign in to comment.