This repository was archived by the owner on Jun 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: WQHD/High-DPI compatibility and Zoom Algorithm Refinements #372
Open
jsaraivx
wants to merge
7
commits into
siddharthvaddem:main
Choose a base branch
from
jsaraivx:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
43ae073
fix(windows): enable high-dpi support and single instance lock
jsaraivx 0085fc5
feat(windows): improve nsis installer and artifact naming
jsaraivx 5e26a63
feat(recorder): increase target capture resolution to 8K
jsaraivx 2f13dc9
feat(editor): disable padding/radius for native aspect ratio
jsaraivx ef883b4
feat(zoom): refine suggestion algorithm with adaptive depth
jsaraivx a682d4f
chore: update lockfile
jsaraivx dc895e3
fix: address PR review feedback on bitrate and zoom logic
jsaraivx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,13 +18,33 @@ import { createEditorWindow, createHudOverlayWindow, createSourceSelectorWindow | |
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| // Single instance lock | ||
| const gotTheLock = app.requestSingleInstanceLock(); | ||
|
|
||
| if (!gotTheLock) { | ||
| app.quit(); | ||
| } else { | ||
| app.on("second-instance", (_event, _commandLine, _workingDirectory) => { | ||
| // Someone tried to run a second instance, we should focus our window. | ||
| if (mainWindow) { | ||
| if (mainWindow.isMinimized()) mainWindow.restore(); | ||
| mainWindow.focus(); | ||
| } | ||
| }); | ||
| } | ||
|
Comment on lines
+21
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. race condition after yo, this is lowkey risky. when common fix is to wrap all app initialization inside the 🛠️ suggested fix - wrap init code in the else block const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
-} else {
+ // Note: app.quit() is async, but we need to prevent further initialization
+ // The process will exit soon, but we should not continue setup
+}
+
+// Only proceed with app initialization if we got the lock
+if (gotTheLock) {
app.on("second-instance", (_event, _commandLine, _workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});
-}
+
+ // ... rest of initialization should be inside this block or guardedalternatively, you could add a guard before if (!gotTheLock) {
app.quit();
// Prevent any further initialization
throw new Error("Another instance is already running");
}or restructure to check the lock before any heavy setup runs. 🤖 Prompt for AI Agents |
||
|
|
||
| // Use Screen & System Audio Recording permissions instead of CoreAudio Tap API on macOS. | ||
| // CoreAudio Tap requires NSAudioCaptureUsageDescription in the parent app's Info.plist, | ||
| // which doesn't work when running from a terminal/IDE during development, makes my life easier | ||
| if (process.platform === "darwin") { | ||
| app.commandLine.appendSwitch("disable-features", "MacCatapLoopbackAudioForScreenShare"); | ||
| } | ||
|
|
||
| if (process.platform === "win32") { | ||
| app.setAppUserModelId("com.siddharthvaddem.openscreen"); | ||
| app.commandLine.appendSwitch("high-dpi-support", "1"); | ||
| } | ||
|
|
||
| export const RECORDINGS_DIR = path.join(app.getPath("userData"), "recordings"); | ||
|
|
||
| async function ensureRecordingsDir() { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
How to configure macOS entitlements in electron-builder for audio input access?💡 Result:
To get microphone (audio input) access working on macOS with electron-builder, you need both:
1) Create an entitlements file (recommended)
build/entitlements.mac.plistApple documents
com.apple.security.device.audio-inputas the entitlement that allows microphone/audio-input access. [1]2) Point electron-builder at the entitlements (+ hardened runtime)
In your
electron-builderconfig:package.json{ "build": { "mac": { "hardenedRuntime": true, "entitlements": "build/entitlements.mac.plist", "entitlementsInherit": "build/entitlements.mac.plist", "extendInfo": { "NSMicrophoneUsageDescription": "This app needs microphone access for voice input." } } } }entitlementssigns the main app with your entitlements.entitlementsInheritsigns helper apps/frameworks with inherited entitlements (electron-builder explicitly supports this and recommends using it). [2]3) If you capture system/desktop audio, add
NSAudioCaptureUsageDescriptiontoo (macOS 14.2+)If you use
desktopCapturerto capture audio, Electron documents that on macOS 14.2+ you must add:NSAudioCaptureUsageDescriptiontoInfo.plist(viaextendInfo) [4]Example:
4) Trigger the permission prompt at runtime
macOS won’t prompt just because the keys exist; you must actually request/use the microphone, e.g.:
navigator.mediaDevices.getUserMedia({ audio: true })(renderer), orsystemPreferences.askForMediaAccess('microphone')(main)(And you must have
NSMicrophoneUsageDescriptionpresent, as above.)Common gotcha
If permissions work in development but not after packaging: the signed .app is a different binary identity than the dev Electron app, so macOS permissions must be granted to (and prompted by) the packaged app.
Sources: Apple entitlement reference [1]; electron-builder Mac configuration (
entitlementsInherit) [2]; electron-builder hardened runtime/notarization guidance [3]; ElectrondesktopCapturerdocs forNSAudioCaptureUsageDescriptionrequirement [4].com.apple.security.device.audio-inputneeds to be in an entitlements file, not extendInfoheads up -
com.apple.security.device.audio-inputis a code signing entitlement, not an Info.plist key. sticking it inextendInfowon't actually do anything. if you're relying on this for sandboxed audio input, it's gonna silently fail.the
NS*keys are legit though - those are meant forextendInfo.you'll need to set this up properly via electron-builder:
build/entitlements.mac.plistwith the entitlementelectron-builder.json5(orpackage.json):keep the
NSMicrophoneUsageDescriptionandNSAudioCaptureUsageDescriptioninextendInfo- those are needed for the permission prompts to actually show up.🤖 Prompt for AI Agents