diff --git a/electron/main.ts b/electron/main.ts index 0a50b6f9..422b8351 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -1041,8 +1041,11 @@ app.whenReady().then(async () => { // pre-selected (e.g. fresh session where the renderer skipped the // source picker entirely). This avoids calling getSources() which // would itself trigger an extra portal dialog. + const isWayland = process.env.XDG_SESSION_TYPE === "wayland"; const isLinuxPortalSentinel = - process.platform === "linux" && (sourceId === "screen:linux-portal" || !sourceId); + process.platform === "linux" && + isWayland && + (sourceId === "screen:linux-portal" || !sourceId); if (isLinuxPortalSentinel) { callback({ video: { id: "screen:0:0", name: "Entire screen" } }); return; diff --git a/electron/windows.ts b/electron/windows.ts index 26b94892..8aa8e2b4 100644 --- a/electron/windows.ts +++ b/electron/windows.ts @@ -181,8 +181,22 @@ function getHudOverlayDisplay() { return getScreen().getPrimaryDisplay(); } + function getHudOverlayBounds() { const { workArea } = getHudOverlayDisplay(); + + if (process.platform === "linux") { + const width = 520; + const height = 220; + + return { + width, + height, + x: Math.round(workArea.x + (workArea.width - width) / 2), + y: workArea.y + workArea.height - 240, + }; + } + return { x: workArea.x, y: workArea.y, @@ -250,7 +264,11 @@ ipcMain.on("hud-overlay-set-ignore-mouse", (_event, ignore: boolean) => { } if (ignore) { - hudOverlayWindow.setIgnoreMouseEvents(true, { forward: true }); + if (process.platform === "linux") { + hudOverlayWindow.setIgnoreMouseEvents(true); + } else { + hudOverlayWindow.setIgnoreMouseEvents(true, { forward: true }); + } return; } @@ -360,7 +378,6 @@ export function createHudOverlayWindow(): BrowserWindow { loadHudOverlayCaptureProtectionSetting(); const initialBounds = getHudOverlayBounds(); let hasShownHudWindow = false; - const win = new BrowserWindow({ width: initialBounds.width, height: initialBounds.height, @@ -383,7 +400,6 @@ export function createHudOverlayWindow(): BrowserWindow { backgroundThrottling: false, }, }); - const showHudWindow = () => { if (hasShownHudWindow || win.isDestroyed()) { return;