From 9d127e389aa182f5d75395a59b3ba7241575f525 Mon Sep 17 00:00:00 2001 From: Stefan Westerfeld Date: Sun, 23 Jun 2019 16:21:15 +0200 Subject: Represent event time as double in seconds on all platforms --- pugl/pugl_x11.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pugl/pugl_x11.c') diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index bd9de42..3bd94df 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -336,7 +336,7 @@ translateEvent(PuglView* view, XEvent xevent) break; case MotionNotify: event.type = PUGL_MOTION_NOTIFY; - event.motion.time = xevent.xmotion.time; + event.motion.time = xevent.xmotion.time / 1e3; event.motion.x = xevent.xmotion.x; event.motion.y = xevent.xmotion.y; event.motion.x_root = xevent.xmotion.x_root; @@ -347,7 +347,7 @@ translateEvent(PuglView* view, XEvent xevent) case ButtonPress: if (xevent.xbutton.button >= 4 && xevent.xbutton.button <= 7) { event.type = PUGL_SCROLL; - event.scroll.time = xevent.xbutton.time; + event.scroll.time = xevent.xbutton.time / 1e3; event.scroll.x = xevent.xbutton.x; event.scroll.y = xevent.xbutton.y; event.scroll.x_root = xevent.xbutton.x_root; @@ -369,7 +369,7 @@ translateEvent(PuglView* view, XEvent xevent) event.button.type = ((xevent.type == ButtonPress) ? PUGL_BUTTON_PRESS : PUGL_BUTTON_RELEASE); - event.button.time = xevent.xbutton.time; + event.button.time = xevent.xbutton.time / 1e3; event.button.x = xevent.xbutton.x; event.button.y = xevent.xbutton.y; event.button.x_root = xevent.xbutton.x_root; @@ -383,7 +383,7 @@ translateEvent(PuglView* view, XEvent xevent) event.type = ((xevent.type == KeyPress) ? PUGL_KEY_PRESS : PUGL_KEY_RELEASE); - event.key.time = xevent.xkey.time; + event.key.time = xevent.xkey.time / 1e3; event.key.x = xevent.xkey.x; event.key.y = xevent.xkey.y; event.key.x_root = xevent.xkey.x_root; @@ -396,7 +396,7 @@ translateEvent(PuglView* view, XEvent xevent) event.type = ((xevent.type == EnterNotify) ? PUGL_ENTER_NOTIFY : PUGL_LEAVE_NOTIFY); - event.crossing.time = xevent.xcrossing.time; + event.crossing.time = xevent.xcrossing.time / 1e3; event.crossing.x = xevent.xcrossing.x; event.crossing.y = xevent.xcrossing.y; event.crossing.x_root = xevent.xcrossing.x_root; -- cgit v1.2.1