Skip to content

Commit

Permalink
Only send change theme event to owned windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Sep 19, 2024
1 parent a908a34 commit 40ada0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ impl<T> EventLoopWindowTarget<T> {
#[inline]
pub fn set_theme(&self, theme: Option<Theme>) {
*self.preferred_theme.lock() = theme;
let _ = unsafe { PostMessageW(HWND_BROADCAST, *CHANGE_THEME_MSG_ID, WPARAM(0), LPARAM(0)) };
self.runner_shared.owned_windows(|window| {
let _ = unsafe { PostMessageW(window, *CHANGE_THEME_MSG_ID, WPARAM(0), LPARAM(0)) };
});
}
}

Expand Down

0 comments on commit 40ada0e

Please sign in to comment.