diff -r 431bd5b568ad surf.c --- a/surf.c Wed Apr 06 18:47:46 2011 +0200 +++ b/surf.c Wed Apr 06 18:56:06 2011 +0200 @@ -79,7 +79,7 @@ static void drawindicator(Client *c); static gboolean exposeindicator(GtkWidget *w, GdkEventExpose *e, Client *c); static void find(Client *c, const Arg *arg); -static const char *getatom(Client *c, int a); +static const char *getatom(Client *c, int a, gboolean delete); static const char *getcookies(SoupURI *uri); static char *geturi(Client *c); void gotheaders(SoupMessage *msg, gpointer user_data); @@ -299,7 +299,7 @@ find(Client *c, const Arg *arg) { const char *s; - s = getatom(c, AtomFind); + s = getatom(c, AtomFind, FALSE); gboolean forward = *(gboolean *)arg; webkit_web_view_search_text(c->view, s, FALSE, forward, TRUE); } @@ -314,7 +314,7 @@ } const char * -getatom(Client *c, int a) { +getatom(Client *c, int a, gboolean delete) { static char buf[BUFSIZ]; Atom adummy; int idummy; @@ -324,6 +324,11 @@ XGetWindowProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), atoms[a], 0L, BUFSIZ, False, XA_STRING, &adummy, &idummy, &ldummy, &ldummy, &p); + + if(delete) + XDeleteProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), + atoms[a]); + if(p) strncpy(buf, (char *)p, LENGTH(buf)-1); else @@ -618,7 +623,7 @@ return GDK_FILTER_REMOVE; } else if(ev->atom == atoms[AtomGo]) { - arg.v = getatom(c, AtomGo); + arg.v = getatom(c, AtomGo, TRUE); loaduri(c, &arg); return GDK_FILTER_REMOVE; }