summaryrefslogtreecommitdiff
path: root/xcb-demo
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2005-12-08 05:54:52 +0000
committerJamey Sharp <jamey@minilop.net>2005-12-08 05:54:52 +0000
commitde8acc7fec9af7636527af9d54ca4cd912d93011 (patch)
tree9e555f2988942dbad45da85eab2cd30077ee3b92 /xcb-demo
parent9a0d030c3920aedeff037625c8d8417e399d66bc (diff)
Make xcbrandr use the new XCBConnect function, instead of doing lots of
work to get the screen number.
Diffstat (limited to 'xcb-demo')
-rw-r--r--xcb-demo/xcbrandr.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/xcb-demo/xcbrandr.c b/xcb-demo/xcbrandr.c
index 8f628ff..cf1a403 100644
--- a/xcb-demo/xcbrandr.c
+++ b/xcb-demo/xcbrandr.c
@@ -120,8 +120,6 @@ main (int argc, char **argv)
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 @@ main (int argc, char **argv)
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);