Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

clippy

Richie McIlroy2f6da9168b96
diff --git a/apps/desktop/src-tauri/src/fake_window.rs b/apps/desktop/src-tauri/src/fake_window.rs
index fb99656a2..31d35d6f5 100644
--- a/apps/desktop/src-tauri/src/fake_window.rs
+++ b/apps/desktop/src-tauri/src/fake_window.rs
@@ -82,22 +82,15 @@ pub fn spawn_fake_window_listener(app: AppHandle, window: WebviewWindow) {
loop {
sleep(Duration::from_millis(1000 / 20)).await;
- if is_recording_controls {
- if let Some(cursor_display_id) = get_display_id_for_cursor() {
- let display_changed = current_display_id
- .as_ref()
- .map_or(true, |id| id != &cursor_display_id);
-
- if display_changed {
- if let Some(display) = get_display_by_id(&cursor_display_id) {
- if let Some((pos_x, pos_y)) = calculate_bottom_center_position(&display)
- {
- let _ =
- window.set_position(tauri::LogicalPosition::new(pos_x, pos_y));
- current_display_id = Some(cursor_display_id);
- }
- }
- }
+ if is_recording_controls && let Some(cursor_display_id) = get_display_id_for_cursor() {
+ let display_changed = current_display_id.as_ref() != Some(&cursor_display_id);
+
+ if display_changed
+ && let Some(display) = get_display_by_id(&cursor_display_id)
+ && let Some((pos_x, pos_y)) = calculate_bottom_center_position(&display)
+ {
+ let _ = window.set_position(tauri::LogicalPosition::new(pos_x, pos_y));
+ current_display_id = Some(cursor_display_id);
}
}
diff --git a/apps/desktop/src-tauri/src/target_select_overlay.rs b/apps/desktop/src-tauri/src/target_select_overlay.rs
index 16ba2eab0..79701942c 100644
--- a/apps/desktop/src-tauri/src/target_select_overlay.rs
+++ b/apps/desktop/src-tauri/src/target_select_overlay.rs
@@ -124,10 +124,9 @@ pub async fn open_target_select_overlays(
if let Ok(CapWindowId::TargetSelectOverlay {
display_id: existing_id,
}) = CapWindowId::from_str(&id)
+ && existing_id != display_id
{
- if existing_id != display_id {
- let _ = window.close();
- }
+ let _ = window.close();
}
}