Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/desktop/src-tauri/src/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use std::{
time::Duration,
};
use tauri::{AppHandle, Manager, path::BaseDirectory};
use tauri_plugin_global_shortcut::GlobalShortcutExt;
use tauri_plugin_dialog::{DialogExt, MessageDialogBuilder};
use tauri_specta::Event;
use tracing::*;
Expand Down Expand Up @@ -3010,6 +3011,20 @@ async fn handle_recording_end(
let _ = window.hide();
}

// Destroy any target-select overlays that were hidden when recording started
// so they don't reappear when the main window comes back.
Comment on lines +3014 to +3015

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment reads like we’re destroying/closing the overlay windows, but the code is hiding them and destroying the focus-manager tasks. Might be worth tweaking wording to match behavior.

Suggested change
// Destroy any target-select overlays that were hidden when recording started
// so they don't reappear when the main window comes back.
// Hide any target-select overlays and tear down their focus managers so they don't reappear
// when the main window comes back.

let focus_manager = handle.try_state::<crate::target_select_overlay::WindowFocusManager>();
for (label, window) in handle.webview_windows() {
if let Ok(CapWindowId::TargetSelectOverlay { display_id }) =
CapWindowId::from_str(&label)
{
hide_overlay(&window);
if let Some(ref fm) = focus_manager {
fm.destroy(&display_id, handle.global_shortcut());
}
}
}

if let Some(camera) = CapWindowId::Camera.get(&handle) {
let _ = camera.hide();
}
Expand Down
5 changes: 4 additions & 1 deletion apps/desktop/src-tauri/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2347,10 +2347,12 @@ impl ShowCapWindow {
}

#[cfg(windows)]
if let Some(bounds) = display.raw_handle().physical_bounds() {
if let Some(bounds) = display.raw_handle().logical_bounds() {
window_builder = window_builder
.inner_size(bounds.size().width(), bounds.size().height())
.position(bounds.position().x(), bounds.position().y());
} else {
window_builder = window_builder.inner_size(100.0, 100.0).position(0.0, 0.0);
}
Comment thread
tembo[bot] marked this conversation as resolved.

#[cfg(target_os = "linux")]
Expand All @@ -2376,6 +2378,7 @@ impl ShowCapWindow {
));
}


#[cfg(target_os = "macos")]
crate::platform::set_window_level(
window.as_ref().window(),
Expand Down
Loading