From 416cd7e9ac7a220c2f0ff2aaa3cb404f6bc556a3 Mon Sep 17 00:00:00 2001 From: sudacode Date: Wed, 30 Sep 2026 19:50:24 -0700 Subject: [PATCH] fix(overlay): keep Hyprland IPC env when forcing mpv X11 backend - Stop stripping HYPRLAND_INSTANCE_SIGNATURE in applyX11EnvOverrides so the overlay can use hyprctl to lift Hyprland's fullscreen input block - Fixes the overlay becoming unclickable over fullscreen mpv with mpv.backend: x11 - Update launcher and backend tests, add changelog fragment --- changes/hyprland-x11-fullscreen-overlay-input.md | 4 ++++ launcher/mpv.test.ts | 3 ++- src/shared/mpv-x11-backend.test.ts | 4 ++-- src/shared/mpv-x11-backend.ts | 6 +++++- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 changes/hyprland-x11-fullscreen-overlay-input.md diff --git a/changes/hyprland-x11-fullscreen-overlay-input.md b/changes/hyprland-x11-fullscreen-overlay-input.md new file mode 100644 index 00000000..c0860632 --- /dev/null +++ b/changes/hyprland-x11-fullscreen-overlay-input.md @@ -0,0 +1,4 @@ +type: fixed +area: overlay + +- Fixed the overlay (subtitles and sidebar) becoming unclickable after mpv goes fullscreen on Hyprland with `mpv.backend: x11`. The launcher no longer strips `HYPRLAND_INSTANCE_SIGNATURE` from the X11 environment, so the overlay can lift Hyprland's fullscreen input block again. diff --git a/launcher/mpv.test.ts b/launcher/mpv.test.ts index 0285b46a..637dc3ea 100644 --- a/launcher/mpv.test.ts +++ b/launcher/mpv.test.ts @@ -179,7 +179,8 @@ test('buildMpvEnv forces X11 by dropping Wayland hints when backend resolves to assert.equal(env.DISPLAY, ':1'); assert.equal(env.WAYLAND_DISPLAY, undefined); assert.equal(env.XDG_SESSION_TYPE, 'x11'); - assert.equal(env.HYPRLAND_INSTANCE_SIGNATURE, undefined); + // The overlay inherits this env and needs hyprctl for its XWayland window. + assert.equal(env.HYPRLAND_INSTANCE_SIGNATURE, 'hypr'); assert.equal(env.SWAYSOCK, undefined); }); }); diff --git a/src/shared/mpv-x11-backend.test.ts b/src/shared/mpv-x11-backend.test.ts index d770ae81..dd27117a 100644 --- a/src/shared/mpv-x11-backend.test.ts +++ b/src/shared/mpv-x11-backend.test.ts @@ -82,7 +82,7 @@ test('shouldForceX11MpvBackend honors explicit x11 and auto modes', () => { }); }); -test('applyX11EnvOverrides strips Wayland hints and pins session type to x11', () => { +test('applyX11EnvOverrides strips Wayland hints, keeps Hyprland IPC, and pins session type to x11', () => { const env = { DISPLAY: ':1', WAYLAND_DISPLAY: 'wayland-0', @@ -94,7 +94,7 @@ test('applyX11EnvOverrides strips Wayland hints and pins session type to x11', ( assert.equal(result, env); // mutates in place assert.equal(result.DISPLAY, ':1'); assert.equal(result.WAYLAND_DISPLAY, undefined); - assert.equal(result.HYPRLAND_INSTANCE_SIGNATURE, undefined); + assert.equal(result.HYPRLAND_INSTANCE_SIGNATURE, 'hypr'); assert.equal(result.SWAYSOCK, undefined); assert.equal(result.XDG_SESSION_TYPE, 'x11'); }); diff --git a/src/shared/mpv-x11-backend.ts b/src/shared/mpv-x11-backend.ts index 8ab88f43..6ec69819 100644 --- a/src/shared/mpv-x11-backend.ts +++ b/src/shared/mpv-x11-backend.ts @@ -89,10 +89,14 @@ export function shouldForceX11MpvBackend( /** * Strip Wayland/compositor hints and pin the session type to X11 on the given env * object (mutates in place and returns it) so a child mpv process picks XWayland. + * + * HYPRLAND_INSTANCE_SIGNATURE is kept: the overlay app inherits this env through the + * mpv plugin, and Hyprland still manages its XWayland windows. Without hyprctl access + * the overlay cannot lift Hyprland's fullscreen input block, so it stays visible but + * unclickable over fullscreen mpv. */ export function applyX11EnvOverrides(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv { delete env.WAYLAND_DISPLAY; - delete env.HYPRLAND_INSTANCE_SIGNATURE; delete env.SWAYSOCK; env.XDG_SESSION_TYPE = 'x11'; return env;