summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Reagle <greg.reagle@umbc.edu>2015-01-27 13:26:26 -0500
committerChristoph Lohmann <20h@r-36.net>2015-02-03 17:25:26 +0100
commitf7e358280cb3bda1f8c46ca021fe94b59a984f5d (patch)
tree9a8a694755a6386c3fd034c94b855419fce67d42
parentb3a4392923b26e81c4faa35907a4a2d071e2275f (diff)
downloadsurf-f7e358280cb3bda1f8c46ca021fe94b59a984f5d.tar.gz
surf-f7e358280cb3bda1f8c46ca021fe94b59a984f5d.tar.bz2
surf-f7e358280cb3bda1f8c46ca021fe94b59a984f5d.zip
surf: see hover URL without changing title
On Tue, Jan 27, 2015, at 11:52 AM, Christoph Lohmann wrote: > Then hook to the window leaving event in GTK or X11 and set the title to > your needs. I will welcome a patch. Patch is attached. I am a total novice in GTK programming, so I don't know what type the callback function is supposed to be (hence the void pointers) or whether I registered it properly. But it does work well for me. -- http://www.fastmail.com - Access your email from home and the web From a33f06da092bf920b6a286ea7688b32944d79a50 Mon Sep 17 00:00:00 2001 From: Greg Reagle <greg.reagle@umbc.edu> 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 Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r--surf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/surf.c b/surf.c
index 36f243e..2e325b1 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;