Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
a5huynh committed Mar 10, 2023
2 parents 99ca5d4 + e4b8154 commit 50ff1fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions crates/tauri/src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use tauri::Window;
use url::Url;

pub fn show_search_bar(window: &Window) {
if let Ok(false) = window.is_visible() {
let _ = window.show();
}

let _ = window.show();
let _ = window.unminimize();
window::center_search_bar(window);
let _ = window.set_focus();
Expand Down
6 changes: 5 additions & 1 deletion crates/tauri/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ pub fn show_search_bar(window: &Window) {
#[cfg(target_os = "windows")]
platform::windows::show_search_bar(window);

// Wait a little bit for the window to show being focusing on it.
let window = window.clone();
let _ = window.emit(ClientEvent::FocusWindow.as_ref(), true);
tauri::async_runtime::spawn(async move {
tokio::time::sleep(tokio::time::Duration::from_millis(256)).await;
let _ = window.emit(ClientEvent::FocusWindow.as_ref(), true);
});
}

pub fn hide_search_bar(window: &Window) {
Expand Down

0 comments on commit 50ff1fe

Please sign in to comment.