Merge lp:~chasedouglas/grail/use-sync-event-time into lp:grail

Proposed by Chase Douglas
Status: Merged
Merged at revision: 212
Proposed branch: lp:~chasedouglas/grail/use-sync-event-time
Merge into: lp:grail
Diff against target: 93 lines (+10/-20)
6 files modified
tools/common/servertime.c (+5/-15)
tools/common/servertime.h (+1/-1)
tools/grail-test-3-1.c (+1/-1)
tools/grail-test-atomic.c (+1/-1)
tools/grail-test-edge.c (+1/-1)
tools/grail-test-propagation.c (+1/-1)
To merge this branch: bzr merge lp:~chasedouglas/grail/use-sync-event-time
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Review via email: mp+98955@code.launchpad.net

Description of the change

Make taps more reliably detected by the tools.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Nice.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/common/servertime.c'
2--- tools/common/servertime.c 2012-01-31 23:47:00 +0000
3+++ tools/common/servertime.c 2012-03-23 01:38:19 +0000
4@@ -57,21 +57,11 @@
5 return -1;
6 }
7
8-static uint64_t get_server_time(Display *display, XSyncCounter counter) {
9- XSyncValue time;
10-
11- if (XSyncQueryCounter(display, counter, &time) != True) {
12- fprintf(stderr, "Warning: failed to get server time\n");
13- return 0;
14- }
15-
16- return (uint64_t)XSyncValueHigh32(time) << 32 | XSyncValueLow32(time);
17-}
18-
19-void update_time(UGHandle handle, Display *display, XSyncCounter counter) {
20- uint64_t server_time = get_server_time(display, counter);
21-
22- grail_update_time(handle, server_time);
23+void update_time(UGHandle handle, XSyncCounterNotifyEvent *event) {
24+ XSyncValue value = event->counter_value;
25+ uint64_t grail_time = (uint64_t)value.hi << 32 | value.lo;
26+
27+ grail_update_time(handle, grail_time);
28 }
29
30 void set_timeout(UGHandle handle, Display *display, XSyncCounter counter) {
31
32=== modified file 'tools/common/servertime.h'
33--- tools/common/servertime.h 2012-01-31 22:27:05 +0000
34+++ tools/common/servertime.h 2012-03-23 01:38:19 +0000
35@@ -27,5 +27,5 @@
36 #include <utouch/grail.h>
37
38 XSyncCounter get_server_time_counter(Display *display);
39-void update_time(UGHandle handle, Display *display, XSyncCounter counter);
40+void update_time(UGHandle handle, XSyncCounterNotifyEvent *event);
41 void set_timeout(UGHandle handle, Display *display, XSyncCounter counter);
42
43=== modified file 'tools/grail-test-3-1.c'
44--- tools/grail-test-3-1.c 2012-02-20 12:53:55 +0000
45+++ tools/grail-test-3-1.c 2012-03-23 01:38:19 +0000
46@@ -331,7 +331,7 @@
47 /* Process any outstanding frame events first */
48 process_frame_events(grail_handle, frame_handle, win,
49 subscriptions);
50- update_time(grail_handle, display, server_time_counter);
51+ update_time(grail_handle, (XSyncCounterNotifyEvent *)&event);
52 }
53 continue;
54 }
55
56=== modified file 'tools/grail-test-atomic.c'
57--- tools/grail-test-atomic.c 2012-02-20 15:44:58 +0000
58+++ tools/grail-test-atomic.c 2012-03-23 01:38:19 +0000
59@@ -346,7 +346,7 @@
60 /* Process any outstanding frame events first */
61 process_frame_events(grail_handle, frame_handle, win,
62 subscriptions);
63- update_time(grail_handle, display, server_time_counter);
64+ update_time(grail_handle, (XSyncCounterNotifyEvent *)&event);
65 }
66 continue;
67 }
68
69=== modified file 'tools/grail-test-edge.c'
70--- tools/grail-test-edge.c 2012-02-20 12:53:55 +0000
71+++ tools/grail-test-edge.c 2012-03-23 01:38:19 +0000
72@@ -345,7 +345,7 @@
73 /* Process any outstanding frame events first */
74 process_frame_events(grail_handle, frame_handle, win,
75 subscriptions);
76- update_time(grail_handle, display, server_time_counter);
77+ update_time(grail_handle, (XSyncCounterNotifyEvent *)&event);
78 }
79 continue;
80 }
81
82=== modified file 'tools/grail-test-propagation.c'
83--- tools/grail-test-propagation.c 2012-02-20 12:53:55 +0000
84+++ tools/grail-test-propagation.c 2012-03-23 01:38:19 +0000
85@@ -313,7 +313,7 @@
86 /* Process any outstanding frame events first */
87 process_frame_events(grail_handle, frame_handle, win,
88 subscriptions);
89- update_time(grail_handle, display, server_time_counter);
90+ update_time(grail_handle, (XSyncCounterNotifyEvent *)&event);
91 }
92 continue;
93 }

Subscribers

People subscribed via source and target branches