Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

fix: ignore programmatic mouse inputs with focus follows cursor (#767)

lars-berger0f9b562ef66b
diff --git a/packages/wm/src/common/platform/event_window.rs b/packages/wm/src/common/platform/event_window.rs
index 10d3a57d..6dbe6c32 100644
--- a/packages/wm/src/common/platform/event_window.rs
+++ b/packages/wm/src/common/platform/event_window.rs
@@ -266,10 +266,13 @@ fn handle_input_msg(
)
};
- // Ignore if data is invalid or not a mouse event.
+ // Ignore if data is invalid or not a mouse event. The `hDevice` check
+ // ignores programmatic mouse inputs via `SendInput` (this caused issues
+ // since `NativeWindow::set_foreground` simulates a mouse input).
if res_size == 0
|| raw_input_size == u32::MAX
|| raw_input.header.dwType != RIM_TYPEMOUSE.0
+ || raw_input.header.hDevice.is_invalid()
{
return Ok(());
}