浏览代码

fix: re-adding focus/blur events for linux and macos (fix #2485) (#2489)

* fix: re-adding focus/blur events for linux and macos, closes #2485

* add change files [skip ci]

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Elvinas Predkelis 4 年之前
父节点
当前提交
3b33d67aa4
共有 3 个文件被更改,包括 13 次插入0 次删除
  1. 6 0
      .changes/fix-focus-blur-events-wry.md
  2. 5 0
      .changes/fix-focus-blur-events.md
  3. 2 0
      core/tauri-runtime-wry/src/lib.rs

+ 6 - 0
.changes/fix-focus-blur-events-wry.md

@@ -0,0 +1,6 @@
+---
+"tauri-runtime-wry": patch
+"tauri": patch
+---
+
+Fixes `WindowEvent::Focus` and `WindowEvent::Blur` events not firing.

+ 5 - 0
.changes/fix-focus-blur-events.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fixes `tauri://focus` and `tauri://blur` events not firing.

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

@@ -516,6 +516,8 @@ impl<'a> From<&WryWindowEvent<'a>> for WindowEventWrapper {
         scale_factor: *scale_factor,
         new_inner_size: PhysicalSizeWrapper(**new_inner_size).into(),
       },
+      #[cfg(any(target_os = "linux", target_os = "macos"))]
+      WryWindowEvent::Focused(focused) => WindowEvent::Focused(*focused),
       _ => return Self(None),
     };
     Self(Some(event))