Skip to content

Commit

Permalink
feature: disable mouse event when building windows on Linux, closes #…
Browse files Browse the repository at this point in the history
…5913 (#6025)

Co-authored-by: Wu Yu Wei <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Fixes #5913
  • Loading branch information
shogohida authored Jan 16, 2023
1 parent 72aa17f commit 8c842a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/linux-mouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-runtime-wry": patch
---

Disable cursor mouse events on Linux.
6 changes: 6 additions & 0 deletions core/tauri-runtime-wry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,12 @@ impl WindowBuilder for WindowBuilderWrapper {
");
}

#[cfg(target_os = "linux")]
{
// Mouse event is disabled on Linux since sudden event bursts could block event loop.
window.inner = window.inner.with_cursor_moved_event(false);
}

if let (Some(min_width), Some(min_height)) = (config.min_width, config.min_height) {
window = window.min_inner_size(min_width, min_height);
}
Expand Down

0 comments on commit 8c842a5

Please sign in to comment.