From 740ba9252dca88be846cf00bb8ad7f2418b060c4 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 18 Sep 2024 10:10:44 +0800 Subject: [PATCH] Rename to EMIT_THEME_MSG_ID --- src/platform_impl/windows/event_loop.rs | 4 ++-- src/platform_impl/windows/window.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index fa9b1439d..b583df4ee 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -619,7 +619,7 @@ lazy_static! { /// Message sent by a `Window` when a new theme is set. /// WPARAM is 1 for dark mode and 0 for light mode. /// and LPARAM is unused. - pub static ref SET_THEME_MSG_ID: u32 = unsafe { + pub static ref EMIT_THEME_MSG_ID: u32 = unsafe { RegisterWindowMessageA(s!("Tao::EmitTheme")) }; /// When the taskbar is created, it registers a message with the "TaskbarCreated" string and then broadcasts this message to all top-level windows @@ -2199,7 +2199,7 @@ unsafe fn public_window_callback_inner( f.set(WindowFlags::MARKER_RETAIN_STATE_ON_SIZE, wparam.0 != 0) }); result = ProcResult::Value(LRESULT(0)); - } else if msg == *SET_THEME_MSG_ID { + } else if msg == *EMIT_THEME_MSG_ID { subclass_input.send_event(Event::WindowEvent { window_id: RootWindowId(WindowId(window.0 as _)), event: WindowEvent::ThemeChanged(if wparam == WPARAM(1) { diff --git a/src/platform_impl/windows/window.rs b/src/platform_impl/windows/window.rs index fee076d8e..82856f14d 100644 --- a/src/platform_impl/windows/window.rs +++ b/src/platform_impl/windows/window.rs @@ -56,7 +56,7 @@ use crate::{ }; use super::{ - event_loop::SET_THEME_MSG_ID, + event_loop::EMIT_THEME_MSG_ID, keyboard::{KeyEventBuilder, KEY_EVENT_BUILDERS}, }; @@ -939,7 +939,7 @@ impl Window { let _ = unsafe { PostMessageW( self.hwnd(), - *SET_THEME_MSG_ID, + *EMIT_THEME_MSG_ID, WPARAM(match new_theme { Theme::Dark => 1, Theme::Light => 0,