fix: native resolution capture + correct click offset for title bar

- Remove restrictive resolution constraints, capture at native res
- Account for window frame/title bar when mapping click coordinates
  (capture includes title bar but sendInputEvent is content-relative)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Administrator 2026-03-12 08:55:46 +01:00
parent b4211a7d50
commit f19d883a69
3 changed files with 9 additions and 9 deletions

View File

@ -22,11 +22,7 @@ async function getCaptureStream() {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: sourceId,
minWidth: 1280,
maxWidth: 1920,
minHeight: 720,
maxHeight: 1080,
maxFrameRate: 30
maxFrameRate: 15
}
}
});

10
main.js
View File

@ -1023,9 +1023,13 @@ ipcMain.on('remote:input-event', (_event, data) => {
if (!remote || !remote.allowInput) return;
if (data.role !== 'admin') return;
const bounds = mainWindow.getContentBounds();
const x = Math.round((data.x || 0) * bounds.width);
const y = Math.round((data.y || 0) * bounds.height);
// Capture includes window frame (title bar), but sendInputEvent is relative to content area
const winBounds = mainWindow.getBounds();
const contentBounds = mainWindow.getContentBounds();
const frameLeft = contentBounds.x - winBounds.x;
const titleBarHeight = contentBounds.y - winBounds.y;
const x = Math.round((data.x || 0) * winBounds.width - frameLeft);
const y = Math.round((data.y || 0) * winBounds.height - titleBarHeight);
switch (data.type) {
case 'mousemove':

View File

@ -1,6 +1,6 @@
{
"name": "multi-hoster-uploader",
"version": "2.1.7",
"version": "2.1.8",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js",
"scripts": {