summary refs log tree commit diff
path: root/gpu_display/src/gpu_display_x.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gpu_display/src/gpu_display_x.rs')
-rw-r--r--gpu_display/src/gpu_display_x.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/gpu_display/src/gpu_display_x.rs b/gpu_display/src/gpu_display_x.rs
index c0074ca..2940f40 100644
--- a/gpu_display/src/gpu_display_x.rs
+++ b/gpu_display/src/gpu_display_x.rs
@@ -11,7 +11,7 @@
 )]
 mod xlib;
 
-use linux_input_sys::input_event;
+use linux_input_sys::virtio_input_event;
 use std::cmp::max;
 use std::collections::BTreeMap;
 use std::ffi::{c_void, CStr, CString};
@@ -333,7 +333,11 @@ impl Surface {
         }
     }
 
-    fn dispatch_to_event_devices(&mut self, events: &[input_event], device_type: EventDeviceKind) {
+    fn dispatch_to_event_devices(
+        &mut self,
+        events: &[virtio_input_event],
+        device_type: EventDeviceKind,
+    ) {
         for event_device in self.event_devices.values_mut() {
             if event_device.kind() != device_type {
                 continue;
@@ -348,7 +352,7 @@ impl Surface {
         match ev.as_enum(self.buffer_completion_type) {
             XEventEnum::KeyEvent(key) => {
                 if let Some(linux_keycode) = self.keycode_translator.translate(key.keycode) {
-                    let events = &[input_event::key(
+                    let events = &[virtio_input_event::key(
                         linux_keycode,
                         key.type_ == xlib::KeyPress as i32,
                     )];
@@ -363,9 +367,9 @@ impl Surface {
                 if button_event.button & xlib::Button1 != 0 {
                     // The touch event *must* be first per the Linux input subsystem's guidance.
                     let events = &[
-                        input_event::touch(pressed),
-                        input_event::absolute_x(max(0, button_event.x) as u32),
-                        input_event::absolute_y(max(0, button_event.y) as u32),
+                        virtio_input_event::touch(pressed),
+                        virtio_input_event::absolute_x(max(0, button_event.x) as u32),
+                        virtio_input_event::absolute_y(max(0, button_event.y) as u32),
                     ];
                     self.dispatch_to_event_devices(events, EventDeviceKind::Touchscreen);
                 }
@@ -373,9 +377,9 @@ impl Surface {
             XEventEnum::Motion(motion) => {
                 if motion.state & xlib::Button1Mask != 0 {
                     let events = &[
-                        input_event::touch(true),
-                        input_event::absolute_x(max(0, motion.x) as u32),
-                        input_event::absolute_y(max(0, motion.y) as u32),
+                        virtio_input_event::touch(true),
+                        virtio_input_event::absolute_x(max(0, motion.x) as u32),
+                        virtio_input_event::absolute_y(max(0, motion.y) as u32),
                     ];
                     self.dispatch_to_event_devices(events, EventDeviceKind::Touchscreen);
                 }