Skip to content

Commit

Permalink
fix: Shortcut toggles focus between vrsjmp and previous app
Browse files Browse the repository at this point in the history
  • Loading branch information
leoshimo committed Feb 16, 2024
1 parent f2f1f17 commit 5c74226
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vrsjmp/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,15 @@ fn main() -> Result<()> {
)
.expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS");

let handle = app.handle();
let mut shortcuts = app.global_shortcut_manager();
shortcuts
.register("CMD+CTRL+SPACE", move || {
let visible = window
.is_visible()
.expect("should retrieve window visibility");
if visible {
let _ = window.hide();
let _ = handle.hide();
} else {
let _ = window.set_focus();
}
Expand Down
2 changes: 1 addition & 1 deletion vrsjmp/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{
"fullscreen": false,
"resizable": false,
"alwaysOnTop": true,
"alwaysOnTop": false,
"maximizable": false,
"minimizable": false,
"closable": false,
Expand Down

0 comments on commit 5c74226

Please sign in to comment.