summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-11-15 14:52:22 +0100
committerChristoph Lohmann <20h@r-36.net>2012-11-15 14:52:22 +0100
commita283fa4bc93167c0f59fcd32bd19a6729d8e057d (patch)
treecf60f1338428b92cf043ceb78fe92920ae487f3c /surf.c
parent244dfd3231d989909566727b9e20d10cdff88a20 (diff)
downloadsurf-a283fa4bc93167c0f59fcd32bd19a6729d8e057d.tar.gz
surf-a283fa4bc93167c0f59fcd32bd19a6729d8e057d.tar.bz2
surf-a283fa4bc93167c0f59fcd32bd19a6729d8e057d.zip
Importing the generic toggle patch of stanio@cs.tu-berlin.de. Thanks!
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/surf.c b/surf.c
index 390eaf0..7fa0eb6 100644
--- a/surf.c
+++ b/surf.c
@@ -126,6 +126,7 @@ static void spawn(Client *c, const Arg *arg);
static void eval(Client *c, const Arg *arg);
static void stop(Client *c, const Arg *arg);
static void titlechange(WebKitWebView *v, WebKitWebFrame* frame, const char* title, Client *c);
+static void toggle(Client *c, const Arg *arg);
static void update(Client *c);
static void updatewinid(Client *c);
static void usage(void);
@@ -890,6 +891,20 @@ titlechange(WebKitWebView *v, WebKitWebFrame *f, const char *t, Client *c) {
}
void
+toggle(Client *c, const Arg *arg) {
+ WebKitWebSettings *settings;
+ char *name = (char *)arg->v;
+ gboolean value;
+ Arg a = { .b = FALSE };
+
+ settings = webkit_web_view_get_settings(c->view);
+ g_object_get(G_OBJECT(settings), name, &value, NULL);
+ g_object_set(G_OBJECT(settings), name, !value, NULL);
+
+ reload(c,&a);
+}
+
+void
update(Client *c) {
char *t;