[Xcb-commit] xcb xcb-demo xcb-util

Ian Osgood iano at kemper.freedesktop.org
Tue May 30 11:54:48 PDT 2006


 xcb-demo/hypnomoire.c         |    3 ++-
 xcb-demo/rendertest.c         |    2 +-
 xcb-demo/tests/flames.c       |    4 ++--
 xcb-demo/tests/julia.c        |    4 ++--
 xcb-demo/tests/lissajoux.c    |    3 +--
 xcb-util/convenient/xcb_aux.c |    6 ++++++
 xcb-util/convenient/xcb_aux.h |    1 +
 xcb/src/xcb.h                 |    8 ++++----
 xcb/src/xcb_util.c            |    5 +----
 9 files changed, 20 insertions(+), 16 deletions(-)

New commits:
diff-tree b39e9256cd11ec3fa1e3ecac1743dbc6412e745a (from 2c6fbfa8ee82a4dbc27b309b2e8beba86d42762c)
Author: Ian Osgood <iano at quirkster.com>
Date:   Tue May 30 11:54:25 2006 -0700

    Deprecate XCBSync, move to XCBAuxSync.

diff --git a/xcb-demo/hypnomoire.c b/xcb-demo/hypnomoire.c
index cb4600b..46e2999 100644
--- a/xcb-demo/hypnomoire.c
+++ b/xcb-demo/hypnomoire.c
@@ -95,6 +95,7 @@ void paint(int idx)
 {
 	XCBCopyArea(c, windows[idx].p, windows[idx].w, white, 0, 0, 0, 0,
 		windows[idx].width, windows[idx].height);
+	/* TODO: better error detection for broken pipe */
 	if(!XCBSync(c, 0))
 	{
 		perror("XCBSync failed");
@@ -149,7 +150,7 @@ void *run(void *param)
 		XCBPolyFillRectangle(c, windows[idx].p, white, 1, &rect);
 	}
 
-	XCBSync(c, 0);
+	XCBFlush(c);
 
 	while(1)
 	{
diff --git a/xcb-demo/rendertest.c b/xcb-demo/rendertest.c
index d738288..82900ba 100644
--- a/xcb-demo/rendertest.c
+++ b/xcb-demo/rendertest.c
@@ -398,7 +398,7 @@ int draw_window(XCBConnection *conn, XCB
     XCBRenderFreePicture(conn, root_picture);
    
     /* sync up and leave the function */
-    XCBSync(conn, 0);
+    XCBFlush(conn);
     return 0;
 }
 
diff --git a/xcb-demo/tests/flames.c b/xcb-demo/tests/flames.c
index 89fd331..1db9b1c 100644
--- a/xcb-demo/tests/flames.c
+++ b/xcb-demo/tests/flames.c
@@ -139,7 +139,7 @@ flame_init ()
   XCBPolyFillRectangle(f->xcb.c, f->xcb.pixmap, gc, 1, &rect_coord);
 
   XCBMapWindow (f->xcb.c, f->xcb.draw.window);
-  XCBSync (f->xcb.c, 0);
+  XCBFlush (f->xcb.c);
 
   f->xcb.cmap = XCBCOLORMAPNew (f->xcb.c);
   XCBCreateColormap (f->xcb.c,
@@ -216,7 +216,7 @@ main ()
 	    case XCBExpose:
 	      XCBCopyArea(f->xcb.c, f->xcb.pixmap, f->xcb.draw, gc,
 		          0, 0, 0, 0, BG_W, BG_H);
-	      XCBSync (f->xcb.c, 0);
+	      XCBFlush (f->xcb.c);
 	      break;
             case XCBButtonPress:
               printf ("Exiting...\n");
diff --git a/xcb-demo/tests/julia.c b/xcb-demo/tests/julia.c
index 6e5b9c2..b22cd5d 100644
--- a/xcb-demo/tests/julia.c
+++ b/xcb-demo/tests/julia.c
@@ -177,7 +177,7 @@ main (int argc, char *argv[])
 
   palette_julia (&data);
 
-  XCBSync (data.conn, 0); 
+  XCBFlush (data.conn); 
 
   while ((e = XCBWaitForEvent(data.conn)))
     {
@@ -188,7 +188,7 @@ main (int argc, char *argv[])
 	    XCBCopyArea(data.conn, rect, data.draw, bgcolor,
 			0, 0, 0, 0, W_W, W_H);
 	    draw_julia (&data);
-	    XCBSync (data.conn, 0);
+	    XCBFlush (data.conn);
 	    break;
 	  }
 	case XCBKeyRelease:
diff --git a/xcb-demo/tests/lissajoux.c b/xcb-demo/tests/lissajoux.c
index f8c8e91..1e787bf 100644
--- a/xcb-demo/tests/lissajoux.c
+++ b/xcb-demo/tests/lissajoux.c
@@ -251,7 +251,7 @@ main (int argc, char *argv[])
   XCBPolyFillRectangle(data.conn, rect, bgcolor, 1, &rect_coord);
 
   data.format = XCBImageFormatZPixmap;
-  XCBSync (data.conn, 0); 
+  XCBFlush (data.conn); 
 
   if (try_shm)
     shm_test (&data);
@@ -273,7 +273,6 @@ main (int argc, char *argv[])
 	    case XCBExpose:
 	      XCBCopyArea(data.conn, rect, data.draw, bgcolor,
 		          0, 0, 0, 0, W_W, W_H);
-	      XCBSync (data.conn, 0);
 	      break;
 	    }
 	  free (e);
diff --git a/xcb-util/convenient/xcb_aux.c b/xcb-util/convenient/xcb_aux.c
index 608d83e..93f7215 100644
--- a/xcb-util/convenient/xcb_aux.c
+++ b/xcb-util/convenient/xcb_aux.c
@@ -63,6 +63,12 @@ XCBAuxGetVisualtype (XCBConnection *c,
    return NULL;
 }
 
+void
+XCBAuxSync (XCBConnection *c)
+{
+    free(XCBGetInputFocusReply(c, XCBGetInputFocus(c), NULL));
+}
+
 /* structs instead of value lists */
 /* TODO: generate the struct types and functions from protocol masks and descriptions */
 
diff --git a/xcb-util/convenient/xcb_aux.h b/xcb-util/convenient/xcb_aux.h
index e8a5db9..6f5381c 100644
--- a/xcb-util/convenient/xcb_aux.h
+++ b/xcb-util/convenient/xcb_aux.h
@@ -12,6 +12,7 @@ XCBVISUALTYPE *XCBAuxGetVisualtype (XCBC
 				    int            screen,
 				    XCBVISUALID    vid);
 
+void           XCBAuxSync          (XCBConnection *c);
 
 /* less error prone to use structs instead of value lists */
 
diff --git a/xcb/src/xcb.h b/xcb/src/xcb.h
index 8e990fd..c7084ff 100644
--- a/xcb/src/xcb.h
+++ b/xcb/src/xcb.h
@@ -477,11 +477,11 @@ XCBConnection *XCBConnectToDisplayWithAu
  * @param e: A pointer to an error.
  * @return @c 1 on success, @c 0 otherwise.
  *
- * Blocks the calling thread for the duration of one round trip to the
- * server, ensuring that all events and errors caused by previous
- * requests are available to XCB.
+ * @deprecated This function is deprecated. It must not be used in
+ * newly written code.  XCBFlush is more efficient.
+ * Use XCBAuxSync if absolutely necessary.
  */
-int XCBSync(XCBConnection *c, XCBGenericError **e);
+int XCBSync(XCBConnection *c, XCBGenericError **e) deprecated;
 
 
 /**
diff --git a/xcb/src/xcb_util.c b/xcb/src/xcb_util.c
index 06b5bca..f5c7cec 100644
--- a/xcb/src/xcb_util.c
+++ b/xcb/src/xcb_util.c
@@ -239,6 +239,7 @@ XCBConnection *XCBConnectToDisplayWithAu
     return XCBConnectToFD(fd, auth);
 }
 
+/* backwards compatible interfaces: remove before 1.0 release */
 int XCBSync(XCBConnection *c, XCBGenericError **e)
 {
     XCBGetInputFocusRep *reply = XCBGetInputFocusReply(c, XCBGetInputFocus(c), e);
@@ -246,10 +247,6 @@ int XCBSync(XCBConnection *c, XCBGeneric
     return reply != 0;
 }
 
-
-
-
-/* backwards compatible interfaces: remove before 1.0 release */
 XCBConnection *XCBConnectBasic()
 {
     XCBConnection *c = XCBConnect(0, 0);


More information about the xcb-commit mailing list