Revert "Merge pull request #289 from hecrj/fix/cursor-events"
`winit` seems to produce `CursorEntered` and `CursorLeft` events after wheel scrolling for no apparent reason (?). This causes annoying flickering when hovering some widgets on a scrollable. I should investigate this further. We are rolling back the fix for the time being.
This commit is contained in:
parent
b44f14e186
commit
ae546a5b9d
|
@ -188,15 +188,8 @@ where
|
||||||
let mut messages = Vec::new();
|
let mut messages = Vec::new();
|
||||||
|
|
||||||
for event in events {
|
for event in events {
|
||||||
match event {
|
if let Event::Mouse(mouse::Event::CursorMoved { x, y }) = event {
|
||||||
Event::Mouse(mouse::Event::CursorMoved { x, y }) => {
|
self.cursor_position = Point::new(x, y);
|
||||||
self.cursor_position = Point::new(x, y);
|
|
||||||
}
|
|
||||||
Event::Mouse(mouse::Event::CursorLeft) => {
|
|
||||||
// TODO: Encode cursor availability
|
|
||||||
self.cursor_position = Point::new(-1.0, -1.0);
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.root.widget.on_event(
|
self.root.widget.on_event(
|
||||||
|
|
|
@ -27,12 +27,6 @@ pub fn window_event(
|
||||||
height: logical_size.height,
|
height: logical_size.height,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
WindowEvent::CursorEntered { .. } => {
|
|
||||||
Some(Event::Mouse(mouse::Event::CursorEntered))
|
|
||||||
}
|
|
||||||
WindowEvent::CursorLeft { .. } => {
|
|
||||||
Some(Event::Mouse(mouse::Event::CursorLeft))
|
|
||||||
}
|
|
||||||
WindowEvent::CursorMoved { position, .. } => {
|
WindowEvent::CursorMoved { position, .. } => {
|
||||||
let position = position.to_logical::<f64>(scale_factor);
|
let position = position.to_logical::<f64>(scale_factor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue