about summary refs log tree commit diff
path: root/surf.c
diff options
context:
space:
mode:
authorEnno Boland (Gottox) <gottox@s01.de>2009-06-08 22:55:48 +0200
committerEnno Boland (Gottox) <gottox@s01.de>2009-06-08 22:55:48 +0200
commitb9b055348d4b8ae9372702afc59793cdcba16144 (patch)
treebc706841dea5410a3f395892f834fa4d519a1491 /surf.c
parentallow all modifiers. (diff)
downloadsurf-b9b055348d4b8ae9372702afc59793cdcba16144.tar.gz
surf-b9b055348d4b8ae9372702afc59793cdcba16144.tar.bz2
surf-b9b055348d4b8ae9372702afc59793cdcba16144.zip
fixing _SURF_URL XProperty.
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/surf.c b/surf.c
index fae33d5..39b6f12 100644
--- a/surf.c
+++ b/surf.c
@@ -272,8 +272,8 @@ loadcommit(WebKitWebView *view, WebKitWebFrame *f, gpointer d) {
 	Client *c = (Client *)d;
 	gchar *uri;
 
-	uri = geturi(c);
 	ignore_once = TRUE;
+	uri = geturi(c);
 	XChangeProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), urlprop,
 			XA_STRING, 8, PropModeReplace, (unsigned char *)uri,
 			strlen(uri) + 1);
@@ -425,12 +425,16 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d) {
 	unsigned char *buf = NULL;
 	if(((XEvent *)e)->type == PropertyNotify) {
 		ev = &((XEvent *)e)->xproperty;
-		if(ignore_once == FALSE && ev->atom == urlprop && ev->state == PropertyNewValue) {
-			XGetWindowProperty(dpy, ev->window, urlprop, 0L, BUFSIZ, False, XA_STRING,
-				&adummy, &idummy, &ldummy, &ldummy, &buf);
-			loaduri(c, (gchar *)buf);
-			XFree(buf);
-			return GDK_FILTER_REMOVE;
+		if(ev->atom == urlprop && ev->state == PropertyNewValue) {
+			if(ignore_once)
+			       ignore_once = FALSE;
+			else {
+				XGetWindowProperty(dpy, ev->window, urlprop, 0L, BUFSIZ, False, XA_STRING,
+					&adummy, &idummy, &ldummy, &ldummy, &buf);
+				loaduri(c, (gchar *)buf);
+				XFree(buf);
+				return GDK_FILTER_REMOVE;
+			}
 		}
 	}
 	return GDK_FILTER_CONTINUE;