Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2874ffd

Browse filesBrowse files
committed
Limit window variable scope in screenshot handler
1 parent efe8674 commit 2874ffd
Copy full SHA for 2874ffd

1 file changed

+5-3Lines changed: 5 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/desktop/src-tauri/src/hotkeys.rs‎

Copy file name to clipboardExpand all lines: apps/desktop/src-tauri/src/hotkeys.rs
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ async fn handle_hotkey(app: AppHandle, action: HotkeyAction) -> Result<(), Strin
221221
HotkeyAction::ScreenshotWindow => {
222222
use scap_targets::Window;
223223

224-
let window = Window::get_topmost_at_cursor()
225-
.ok_or_else(|| "No window found under cursor".to_string())?;
226-
let target = ScreenCaptureTarget::Window { id: window.id() };
224+
let target = {
225+
let window = Window::get_topmost_at_cursor()
226+
.ok_or_else(|| "No window found under cursor".to_string())?;
227+
ScreenCaptureTarget::Window { id: window.id() }
228+
};
227229

228230
match recording::take_screenshot(app.clone(), target).await {
229231
Ok(path) => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.