[Xcb-commit] xcb-demo xcbrandr.c,1.1,1.2
Jamey Sharp
xcb-commit at lists.freedesktop.org
Wed Dec 7 21:54:54 PST 2005
Update of /cvs/xcb/xcb-demo
In directory gabe:/tmp/cvs-serv21406
Modified Files:
xcbrandr.c
Log Message:
Make xcbrandr use the new XCBConnect function, instead of doing lots of work to get the screen number.
Index: xcbrandr.c
===================================================================
RCS file: /cvs/xcb/xcb-demo/xcbrandr.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xcbrandr.c 11 Feb 2005 20:58:50 -0000 1.1
+++ xcbrandr.c 8 Dec 2005 05:54:52 -0000 1.2
@@ -120,8 +120,6 @@
XCBGenericEvent *event;
XCBRandRScreenChangeNotifyEvent *sce;
char *display_name = NULL;
- char *host;
- int display;
int i, j;
int current_size;
short current_rate;
@@ -219,27 +217,7 @@
if (verbose) query = 1;
- if (!XCBParseDisplay(display_name, &host, &display, &screen)) {
- fprintf(stderr, "Invalid DISPLAY\n");
- exit(1);
- }
-
- int fd = XCBOpen(host, display);
- free(host);
- if (fd == -1) {
- fprintf(stderr, "Error: XCBOpen\n");
- exit(1);
- }
-
- /* Now we open the connection */
- XCBAuthInfo auth;
- XCBGetAuthInfo(fd, &auth);
- c = XCBConnect(fd, &auth);
-
- /* Free auth data */
- free(auth.name);
- free(auth.data);
-
+ c = XCBConnect(display_name, &screen);
if (!c) {
fprintf (stderr, "Can't open display %s\n", display_name);
exit (1);
More information about the xcb-commit
mailing list