Skip to content

Commit

Permalink
Rename to EMIT_THEME_MSG_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Sep 18, 2024
1 parent c18000f commit 740ba92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2199,7 +2199,7 @@ unsafe fn public_window_callback_inner<T: 'static>(
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) {
Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 740ba92

Please sign in to comment.