summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2017-05-12 00:28:24 +0200
committerQuentin Rameau <quinq@fifth.space>2017-05-12 00:30:51 +0200
commitf5be376ccc1fef96722df610c4783e99ce1e944e (patch)
tree74a03b5837b6afd1b7fc94df0170665ec5521432
parent5e2216c41434219e60ca52bc5f10d34fddbca964 (diff)
downloadsurf-f5be376ccc1fef96722df610c4783e99ce1e944e.tar.gz
surf-f5be376ccc1fef96722df610c4783e99ce1e944e.tar.bz2
surf-f5be376ccc1fef96722df610c4783e99ce1e944e.zip
Fix synchronization issue with atoms
Be sure to sync after setting an atom. Sync too before reading one.
-rw-r--r--surf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/surf.c b/surf.c
index f02418a..2d3a6f5 100644
--- a/surf.c
+++ b/surf.c
@@ -530,10 +530,10 @@ geturi(Client *c)
void
setatom(Client *c, int a, const char *v)
{
- XSync(dpy, False);
XChangeProperty(dpy, c->xid,
atoms[a], XA_STRING, 8, PropModeReplace,
(unsigned char *)v, strlen(v) + 1);
+ XSync(dpy, False);
}
const char *
@@ -545,6 +545,7 @@ getatom(Client *c, int a)
unsigned long ldummy;
unsigned char *p = NULL;
+ XSync(dpy, False);
XGetWindowProperty(dpy, c->xid, atoms[a], 0L, BUFSIZ, False, XA_STRING,
&adummy, &idummy, &ldummy, &ldummy, &p);
if (p)