send frame after every pointer event to 'commit' it

This commit is contained in:
Ferdinand Schober
2022-09-19 18:04:43 +02:00
parent 35414059a8
commit 2cd522044a
3 changed files with 12 additions and 27 deletions

View File

@@ -114,10 +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); }
protocol::Event::Button { t, b, s } => { pointer.button(t, b, s); }
protocol::Event::Axis { t, a, v } => { pointer.axis(t, a, v); }
protocol::Event::Key { t, k, s } => { keyboard.key(t, k, u32::from(s)); },
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::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);
},