2 Commits
Author SHA1 Message Date
Илья Глазунов cbf82f9317 Refactor screen capture handler to use system picker across all platforms
Build and Release / build (x64, ubuntu-latest, linux) (push) Has been skipped
Build and Release / build (arm64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, windows-latest, win32) (push) Has been cancelled
Build and Release / release (push) Has been cancelled
2026-01-15 19:28:45 +03:00
Илья Глазунов bf9ec15912 Bump version to 0.5.3 and enhance Windows audio capture using loopback
Build and Release / build (x64, ubuntu-latest, linux) (push) Has been skipped
Build and Release / build (arm64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, windows-latest, win32) (push) Has been cancelled
Build and Release / release (push) Has been cancelled
2026-01-15 19:20:34 +03:00
2 changed files with 10 additions and 66 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "cheating-daddy", "name": "cheating-daddy",
"productName": "cheating-daddy", "productName": "cheating-daddy",
"version": "0.5.2", "version": "0.5.3",
"description": "cheating daddy", "description": "cheating daddy",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
+9 -65
View File
@@ -35,71 +35,15 @@ function createWindow(sendToRenderer, geminiSessionRef) {
const { session, desktopCapturer } = require('electron'); const { session, desktopCapturer } = require('electron');
// Setup display media request handler for screen capture // Setup display media request handler for screen capture
if (process.platform === 'darwin') { // Use system picker on all platforms to let user choose screen/window and audio
// On macOS, use SystemAudioDump for audio (not browser loopback) session.defaultSession.setDisplayMediaRequestHandler(
// So we just need to capture the screen (request, callback) => {
session.defaultSession.setDisplayMediaRequestHandler( // Don't call callback - let system picker handle the selection
async (request, callback) => { // The system will call callback with user's choice
try { console.log('Showing system screen picker dialog...');
const sources = await desktopCapturer.getSources({ },
types: ['screen'], { useSystemPicker: true }
thumbnailSize: { width: 0, height: 0 } // Skip thumbnail generation for speed );
});
if (sources.length === 0) {
console.error('No screen sources available');
callback(null);
return;
}
// On macOS, directly use the first screen (system already granted permission)
// Audio is handled separately by SystemAudioDump
console.log('Screen capture source:', sources[0].name);
callback({ video: sources[0], audio: 'loopback' });
} catch (error) {
console.error('Error getting screen sources:', error);
callback(null);
}
},
{ useSystemPicker: false } // Disable system picker, use our source directly
);
} else if (process.platform === 'win32') {
// On Windows, use system picker so user can enable "Share audio" checkbox
// This is REQUIRED for system audio capture on Windows
session.defaultSession.setDisplayMediaRequestHandler(
(request, callback) => {
console.log('Windows: Using system picker for screen/audio selection');
// Don't call callback - let system picker handle it
// The system picker will provide both video and audio if user checks the box
},
{ useSystemPicker: true }
);
} else {
// On Linux, try to get system audio via loopback
session.defaultSession.setDisplayMediaRequestHandler(
async (request, callback) => {
try {
const sources = await desktopCapturer.getSources({
types: ['screen'],
thumbnailSize: { width: 0, height: 0 }
});
if (sources.length === 0) {
console.error('No screen sources available');
callback(null);
return;
}
console.log('Linux: Using screen source with loopback audio');
callback({ video: sources[0], audio: 'loopback' });
} catch (error) {
console.error('Error getting screen sources:', error);
callback(null);
}
},
{ useSystemPicker: false }
);
}
mainWindow.setResizable(false); mainWindow.setResizable(false);
mainWindow.setContentProtection(true); mainWindow.setContentProtection(true);