query sync counter. Round trip to fix, though
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 1 Oct 2009 09:03:23 +0000 (09:03 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 1 Oct 2009 09:03:23 +0000 (09:03 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@42835 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xcb/ecore_xcb_sync.c

index 5b1fd0b..d3a22dd 100644 (file)
@@ -135,3 +135,25 @@ ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm)
    return 0;
 #endif /* ECORE_XCB_SYNC */
 }
+
+/* FIXME: round trip */
+
+EAPI int
+ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter, unsigned int *val)
+{
+#ifdef ECORE_XCB_SYNC
+  xcb_sync_query_counter_cookie_t cookie;
+  xcb_sync_query_counter_reply_t *reply;
+
+  cookie = xcb_sync_query_counter_unchecked(_ecore_xcb_conn, counter);
+  reply = xcb_sync_query_counter_reply(_ecore_xcb_conn, cookie, NULL);
+  if (reply)
+    {
+       *val = (unsigned int)reply->counter_value.lo;
+       free(reply);
+       return 1;
+    }
+#endif /* ECORE_XCB_SYNC */
+
+  return 0;
+}