static Client *clients = NULL;
static GdkNativeWindow embed = 0;
static gboolean showxid = FALSE;
-static int ignorexprop = 0;
+static Time lastxprop = 0;
static char winid[64];
static char *progname;
static gboolean lockcookie = FALSE;
g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
g_free(uri);
setatom(c, findprop, "");
+ setatom(c, uriprop, "");
c->download = NULL;
c->title = NULL;
if(((XEvent *)e)->type == PropertyNotify) {
ev = &((XEvent *)e)->xproperty;
- if(ignorexprop)
- ignorexprop--;
- else if(ev->state == PropertyNewValue) {
+ if((!lastxprop || lastxprop + 512 < ev->time)
+ && ev->state == PropertyNewValue) {
if(ev->atom == uriprop) {
arg.v = getatom(c, uriprop);
loaduri(c, &arg);
arg.b = TRUE;
find(c, &arg);
}
+ lastxprop = ev->time;
return GDK_FILTER_REMOVE;
}
}
void
setatom(Client *c, Atom a, const char *v) {
- XSync(dpy, False);
- ignorexprop++;
XChangeProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), a,
XA_STRING, 8, PropModeReplace, (unsigned char *)v,
strlen(v) + 1);
+ XSync(dpy, False);
}
void