Fix scrolling for all Electron-based applications
This commit is contained in:
@@ -366,10 +366,18 @@ where
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let haptics = hovered.backend.on_hover(app, &hit);
|
let scroll_threshold = 0.1;
|
||||||
|
let mut haptics: Option<Haptics> = None;
|
||||||
|
|
||||||
|
// Pass mouse motion events only if not scrolling
|
||||||
|
// (allows scrolling on all Chromium-based applications)
|
||||||
|
if app.input_state.pointers[idx].now.scroll.abs() <= scroll_threshold {
|
||||||
|
haptics = hovered.backend.on_hover(app, &hit);
|
||||||
|
}
|
||||||
|
|
||||||
pointer = &mut app.input_state.pointers[idx];
|
pointer = &mut app.input_state.pointers[idx];
|
||||||
|
|
||||||
if pointer.now.scroll.abs() > 0.1 {
|
if pointer.now.scroll.abs() > scroll_threshold {
|
||||||
let scroll = pointer.now.scroll;
|
let scroll = pointer.now.scroll;
|
||||||
if app.input_state.pointers[1 - idx]
|
if app.input_state.pointers[1 - idx]
|
||||||
.interaction
|
.interaction
|
||||||
|
|||||||
Reference in New Issue
Block a user