From a33f06da092bf920b6a286ea7688b32944d79a50 Mon Sep 17 00:00:00 2001 From: Greg Reagle Date: Tue, 27 Jan 2015 13:22:15 -0500 Subject: [PATCH] ensure that window title is web page title (not hover link) when leaving window --- surf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/surf.c b/surf.c index 48f6b39..40fa488 100644 --- a/surf.c +++ b/surf.c @@ -179,6 +179,7 @@ static void source(Client *c, const Arg *arg); static void spawn(Client *c, const Arg *arg); static void stop(Client *c, const Arg *arg); static void titlechange(WebKitWebView *view, GParamSpec *pspec, Client *c); +static void titlechangeleave(void *a, void *b, Client *c); static void toggle(Client *c, const Arg *arg); static void togglecookiepolicy(Client *c, const Arg *arg); static void togglegeolocation(Client *c, const Arg *arg); @@ -805,6 +806,9 @@ newclient(void) { g_signal_connect(G_OBJECT(c->win), "destroy", G_CALLBACK(destroywin), c); + g_signal_connect(G_OBJECT(c->win), + "leave_notify_event", + G_CALLBACK(titlechangeleave), c); if(!kioskmode) addaccelgroup(c); @@ -1299,6 +1303,12 @@ titlechange(WebKitWebView *view, GParamSpec *pspec, Client *c) { } static void +titlechangeleave(void *a, void *b, Client *c) { + c->linkhover = NULL; + updatetitle(c); +} + +static void toggle(Client *c, const Arg *arg) { WebKitWebSettings *settings; char *name = (char *)arg->v; -- 1.9.1