proper frame events

This commit is contained in:
Ferdinand Schober
2022-09-19 18:46:32 +02:00
parent 2cd522044a
commit ed3882df57
3 changed files with 16 additions and 7 deletions

View File

@@ -114,9 +114,10 @@ fn udp_loop(connection: &protocol::Connection, pointer: &Vp, keyboard: &Vk, q: E
loop {
if let Some(event) = connection.receive_event() {
match event {
protocol::Event::Mouse { t, x, y } => { pointer.motion(t, x, y); pointer.frame(); }
protocol::Event::Button { t, b, s } => { pointer.button(t, b, s); pointer.frame(); }
protocol::Event::Axis { t, a, v } => { pointer.axis(t, a, v); pointer.frame(); }
protocol::Event::Mouse { t, x, y } => { pointer.motion(t, x, y); }
protocol::Event::Button { t, b, s } => { pointer.button(t, b, s); }
protocol::Event::Axis { t, a, v } => { pointer.axis(t, a, v); }
protocol::Event::Frame { } => { pointer.frame(); },
protocol::Event::Key { t, k, s } => { keyboard.key(t, k, u32::from(s)); pointer.frame(); },
protocol::Event::KeyModifier { mods_depressed, mods_latched, mods_locked, group } => {
keyboard.modifiers(mods_depressed, mods_latched, mods_locked, group);

View File

@@ -364,6 +364,9 @@ impl Dispatch<wl_pointer::WlPointer, ()> for App {
let e = protocol::Event::Axis { t: time, a: (axis.into_result().unwrap()), v: value };
app.connection.send_event(&e);
}
wl_pointer::Event::Frame {} => {
app.connection.send_event(&protocol::Event::Frame{});
}
_ => (),
}
}