summaryrefslogtreecommitdiffstats
path: root/src/vdagent-x11.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-06-20 23:29:54 +0300
committerAlon Levy <alevy@redhat.com>2012-06-24 09:38:25 +0300
commitec738648c35b13589e1d8255dc0467a9ac9cf52f (patch)
treee76f6b6baddb789f33156367a67a73252771f677 /src/vdagent-x11.c
parentcb875724da7233ab407f63ddbb98b083147d9fe4 (diff)
downloadvd_agent-ec738648c35b13589e1d8255dc0467a9ac9cf52f.tar.gz
vd_agent-ec738648c35b13589e1d8255dc0467a9ac9cf52f.tar.xz
vd_agent-ec738648c35b13589e1d8255dc0467a9ac9cf52f.zip
vdagent: add -y for sync X11 communication
Diffstat (limited to 'src/vdagent-x11.c')
-rw-r--r--src/vdagent-x11.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c
index 38c4205..3af8e75 100644
--- a/src/vdagent-x11.c
+++ b/src/vdagent-x11.c
@@ -67,8 +67,13 @@ static const char *vdagent_x11_sel_to_str(uint8_t selection) {
}
}
+static int debug_error_handler(Display *display, XErrorEvent *error)
+{
+ abort();
+}
+
struct vdagent_x11 *vdagent_x11_create(struct udscs_connection *vdagentd,
- FILE *errfile, int verbose)
+ FILE *errfile, int verbose, int sync)
{
struct vdagent_x11 *x11;
XWindowAttributes attrib;
@@ -91,6 +96,11 @@ struct vdagent_x11 *vdagent_x11_create(struct udscs_connection *vdagentd,
return NULL;
}
+ if (sync) {
+ XSetErrorHandler(debug_error_handler);
+ XSynchronize(x11->display, True);
+ }
+
x11->screen = DefaultScreen(x11->display);
x11->root_window = RootWindow(x11->display, x11->screen);
x11->fd = ConnectionNumber(x11->display);