Skip to content

Commit

Permalink
Ignore screen scaling by default. Can be enabled via --consider-scale
Browse files Browse the repository at this point in the history
  • Loading branch information
mPyKen committed Nov 30, 2021
1 parent f1d044d commit 20db721
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ if (require("electron-squirrel-startup")) {
app.quit();
}

// ignore dpi scaling as per https://stackoverflow.com/a/57924406
const considerScale = app.commandLine.hasSwitch('consider-scale')
if (!considerScale) {
app.commandLine.appendSwitch('high-dpi-support', 1)
app.commandLine.appendSwitch('force-device-scale-factor', 1)
}

ipcMain.on("set-ignore-mouse-events", (event, ...args) => {
BrowserWindow.fromWebContents(event.sender).setIgnoreMouseEvents(...args);
});
Expand Down
2 changes: 1 addition & 1 deletion src/render.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script defer src="render.js"></script>
</head>
<body>
<div class="crop">
<div class="crop" style="-webkit-app-region: drag">
<div class="margin">
<video style="-webkit-app-region: drag"></video>
<div class="mask"><div class="info">Drag me or the red border!</div></div>
Expand Down

0 comments on commit 20db721

Please sign in to comment.