Skip to content

Commit 0c62d46

Browse files
committed
fix: use a different window classes when in debug mode
1 parent 9638d57 commit 0c62d46

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/host.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ pub unsafe fn create_host(
143143
let mut rect = RECT::default();
144144
GetClientRect(taskbar_hwnd, &mut rect)?;
145145

146+
#[cfg(debug_assertions)]
147+
let window_class = w!("komorebi-switcher-debug::host");
148+
#[cfg(not(debug_assertions))]
146149
let window_class = w!("komorebi-switcher::host");
147150

148151
let wc = WNDCLASSW {

src/main_window.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ impl App {
3838
let parent = unsafe { NonZero::new_unchecked(host.0 as _) };
3939
let parent = Win32WindowHandle::new(parent);
4040
let parent = RawWindowHandle::Win32(parent);
41-
4241
attrs = unsafe { attrs.with_parent_window(Some(parent)) };
42+
43+
#[cfg(debug_assertions)]
44+
let class_name = "komorebi-switcher-debug::window";
45+
#[cfg(not(debug_assertions))]
46+
let class_name = "komorebi-switcher::window";
47+
4348
attrs = attrs
4449
.with_decorations(false)
4550
.with_transparent(true)
4651
.with_active(false)
47-
.with_class_name("komorebi-switcher::window")
52+
.with_class_name(class_name)
4853
.with_undecorated_shadow(false)
4954
.with_no_redirection_bitmap(true)
5055
.with_clip_children(false);

0 commit comments

Comments
 (0)