Skip to content

Commit f17ff8a

Browse files
wip
1 parent fbe7f97 commit f17ff8a

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

apps/desktop/src-tauri/src/target_select_overlay.rs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,24 @@ pub async fn open_target_select_overlays(
6161
let app = app.clone();
6262
async move {
6363
loop {
64-
{
65-
let display = cap_displays::Display::get_containing_cursor();
66-
let window = cap_displays::Window::get_topmost_at_cursor();
67-
let _ = TargetUnderCursor {
68-
display_id: display.map(|d| d.id()),
69-
window: window.and_then(|w| {
70-
Some(WindowUnderCursor {
71-
id: w.id(),
72-
bounds: w.display_relative_logical_bounds()?,
73-
app_name: w.owner_name()?,
74-
icon: w.app_icon().map(|bytes| {
75-
format!(
76-
"data:image/png;base64,{}",
77-
BASE64_STANDARD.encode(&bytes)
78-
)
79-
}),
80-
})
81-
}),
82-
}
83-
.emit(&app);
64+
let display = cap_displays::Display::get_containing_cursor();
65+
let window = cap_displays::Window::get_topmost_at_cursor();
66+
67+
let _ = TargetUnderCursor {
68+
display_id: display.map(|d| d.id()),
69+
window: window.and_then(|w| {
70+
Some(WindowUnderCursor {
71+
id: w.id(),
72+
bounds: w.display_relative_logical_bounds()?,
73+
app_name: w.owner_name()?,
74+
icon: w.app_icon().map(|bytes| {
75+
format!("data:image/png;base64,{}", BASE64_STANDARD.encode(&bytes))
76+
}),
77+
})
78+
}),
8479
}
80+
.emit(&app);
81+
8582
tokio::time::sleep(Duration::from_millis(50)).await;
8683
}
8784
}

0 commit comments

Comments
 (0)