From 199facefb038b00b7b2fdaedbb89c72d6fe82235 Mon Sep 17 00:00:00 2001 From: wizlor-bfw Date: Fri, 7 Aug 2026 02:23:07 +0000 Subject: [PATCH] fix(desktop): clear overlay restore label on recording mode switch Switching recording mode while a "restore this overlay when Settings closes" instruction is pending left it stale, so the target-select overlay could pop back up as a screen-wide input-eating surface after the user had already moved to a different mode. Fixes #1945. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QGraCJTpXDy24K5g3wwfhD --- apps/desktop/src-tauri/src/recording_settings.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src-tauri/src/recording_settings.rs b/apps/desktop/src-tauri/src/recording_settings.rs index c8935289818..95ca3c2670f 100644 --- a/apps/desktop/src-tauri/src/recording_settings.rs +++ b/apps/desktop/src-tauri/src/recording_settings.rs @@ -7,7 +7,7 @@ use cap_recording::{ sources::screen_capture::ScreenCaptureTarget, }; use std::collections::HashMap; -use tauri::{AppHandle, Wry}; +use tauri::{AppHandle, Manager, Wry}; use tauri_plugin_store::StoreExt; use crate::tray; @@ -92,5 +92,15 @@ pub fn camera_key(id: &DeviceOrModelID) -> String { pub fn set_recording_mode(app: AppHandle, mode: RecordingMode) -> Result<(), String> { RecordingSettingsStore::set_mode(&app, mode)?; tray::update_tray_icon_for_mode(&app, mode); + + // A mode switch invalidates any pending "restore this overlay when + // Settings closes" instruction — otherwise a stale label can pop the + // target-select overlay back up as a screen-wide input-eating surface + // after the user has moved on to a different mode. See #1945. + if let Some(focus_manager) = app.try_state::() + { + focus_manager.clear_overlay_restore_labels(); + } + Ok(()) }