From bceaae990f0285f0f07f91b1a15d481ab628bc56 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 18 Sep 2024 14:50:04 +0800 Subject: [PATCH] Ignore post message error instead of panic --- src/platform_impl/windows/event_loop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 546ce64b0..8ca652fbd 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -334,7 +334,7 @@ impl EventLoopWindowTarget { #[inline] pub fn set_theme(&self, theme: Option) { *self.preferred_theme.lock() = theme; - unsafe { PostMessageW(HWND_BROADCAST, *CHANGE_THEME_MSG_ID, WPARAM(0), LPARAM(0)).unwrap() }; + let _ = unsafe { PostMessageW(HWND_BROADCAST, *CHANGE_THEME_MSG_ID, WPARAM(0), LPARAM(0)) }; } }