Skip to content

Commit

Permalink
fix: ignore programmatic mouse inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Oct 4, 2024
1 parent adc6d56 commit d7344b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/wm/src/common/platform/event_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}
Expand Down

0 comments on commit d7344b8

Please sign in to comment.