[gtk+/wip/mir2: 286/310] mir: add a NANO_TO_MILLI conversion macro
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/mir2: 286/310] mir: add a NANO_TO_MILLI conversion macro
- Date: Thu, 5 Feb 2015 16:22:41 +0000 (UTC)
commit dbf0a779b5476a7f2807194802b692f5dd67d890
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Tue Dec 2 16:25:18 2014 +0100
mir: add a NANO_TO_MILLI conversion macro
gdk/mir/gdkmireventsource.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
index a02adff..701f394 100644
--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -22,6 +22,8 @@
#include "gdkmir.h"
#include "gdkmir-private.h"
+#define NANO_TO_MILLI(x) (x / 1000000)
+
struct _GdkMirWindowReference {
GdkMirEventSource *source;
GdkWindow *window;
@@ -273,7 +275,7 @@ handle_key_event (GdkWindow *window, const MirKeyEvent *event)
event->key_code,
event->scan_code,
is_modifier,
- event->event_time / 1000000);
+ NANO_TO_MILLI (event->event_time));
break;
default:
//case mir_key_action_multiple:
@@ -301,7 +303,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
y = event->pointer_coordinates[0].y;
}
modifier_state = get_modifier_state (event->modifiers, event->button_state);
- event_time = event->event_time / 1000000;
+ event_time = NANO_TO_MILLI (event->event_time);
/* The Mir events generate hover-exits even while inside the window so
counteract this by always generating an enter notify on all other events */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]