From 81303d81a83c904e134aa706430ce9253d0b3ed9 Mon Sep 17 00:00:00 2001 From: killian Date: Tue, 20 Sep 2022 20:26:37 +0200 Subject: [PATCH] On Windows, fixed focus event emission on minimize. --- CHANGELOG.md | 2 ++ src/platform_impl/windows/event_loop.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c402060..dcbee0cca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre # Unreleased +- On Windows, fixed focus event emission on minimize. + # 0.27.3 (2022-9-10) - On Windows, added `WindowExtWindows::set_undecorated_shadow` and `WindowBuilderExtWindows::with_undecorated_shadow` to draw the drop shadow behind a borderless window. diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 30401a7a9..7380350c9 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -1900,7 +1900,7 @@ unsafe fn public_window_callback_inner( } WM_NCACTIVATE => { - let is_active = wparam == 1; + let is_active = wparam != false.into(); let active_focus_changed = userdata.window_state.lock().set_active(is_active); if active_focus_changed { if is_active {