소스 검색

chore: add note about focusing the webview (#2545)

Amr Bashir 3 년 전
부모
커밋
ad17b9bf2a
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      core/tauri-runtime-wry/src/lib.rs

+ 2 - 0
core/tauri-runtime-wry/src/lib.rs

@@ -1927,6 +1927,8 @@ fn handle_event_loop(
     Event::WindowEvent {
       event, window_id, ..
     } => {
+      // NOTE(amrbashir): we handle this event here instead of `match` statement below because
+      // we want to focus the webview as soon as possible, especially on windows.
       if event == WryWindowEvent::Focused(true) {
         if let Some(WindowHandle::Webview(webview)) = windows.get(&window_id).map(|w| &w.inner) {
           webview.focus();