Introduction
Introduction Statistics Contact Development Disclaimer Help
tImporting the generic toggle patch of [email protected]. Thanks! - surf -…
git clone git://src.adamsgaard.dk/surf
Log
Files
Refs
README
LICENSE
---
commit a283fa4bc93167c0f59fcd32bd19a6729d8e057d
parent 244dfd3231d989909566727b9e20d10cdff88a20
Author: Christoph Lohmann <[email protected]>
Date: Thu, 15 Nov 2012 14:52:22 +0100
Importing the generic toggle patch of [email protected]. Thanks!
Diffstat:
M config.def.h | 4 ++++
M surf.c | 15 +++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/config.def.h b/config.def.h
t@@ -52,5 +52,9 @@ static Key keys[] = {
{ MODKEY, GDK_slash, spawn, SETPROP("_SURF_FIND", "_SU…
{ MODKEY, GDK_n, find, { .b = TRUE } },
{ MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } },
+ { MODKEY, GDK_v, toggle, { .v = "enable-plugins" } …
+ { MODKEY|GDK_SHIFT_MASK,GDK_i, toggle, { .v = "auto-load-images" …
+ { MODKEY, GDK_c, toggle, { .v = "enable-caret-brows…
+ { MODKEY|GDK_SHIFT_MASK,GDK_s, toggle, { .v = "enable-scripts" } …
};
diff --git a/surf.c b/surf.c
t@@ -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* t…
+static void toggle(Client *c, const Arg *arg);
static void update(Client *c);
static void updatewinid(Client *c);
static void usage(void);
t@@ -890,6 +891,20 @@ titlechange(WebKitWebView *v, WebKitWebFrame *f, const ch…
}
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;
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.