[wiki] [sites] Kiosk mode is now in vanilla surf. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Mon, 11 Mar 2013 21:30:25 +0100

commit 99f5654ee3ddf10bc95ecedd11d50f062cafa15e
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Mon Mar 11 21:28:00 2013 +0100

    Kiosk mode is now in vanilla surf.

diff --git a/surf.suckless.org/files/kioskmode.md b/surf.suckless.org/files/kioskmode.md
index 7b594e3..271a668 100644
--- a/surf.suckless.org/files/kioskmode.md
+++ b/surf.suckless.org/files/kioskmode.md
_AT_@ -19,9 +19,6 @@ This software has to be installed on the system for my whoto to work:
 
 Feel free to use other components if desired.
 
-I do apply a patch to 'surf' that adds parameter '-k' and disables all
-key strokes. See the [patches](../patches/kioskmode) section for the patch.
-
 Basic setup
 -----------
 
diff --git a/surf.suckless.org/patches/surf-kiosk.diff b/surf.suckless.org/patches/surf-kiosk.diff
deleted file mode 100644
index 3cdca38..0000000
--- a/surf.suckless.org/patches/surf-kiosk.diff
+++ /dev/null
_AT_@ -1,86 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index d9a2be9..adfa7a6 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -8,6 +8,7 @@ static char *cookiefile = "~/.surf/cookies.txt";
- static time_t sessiontime = 3600;
- static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
- static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
-+static Bool kioskmode = FALSE;
-
- /* Webkit default features */
- static Bool enablescrollbars = TRUE;
-diff --git a/surf.1 b/surf.1
-index 97c00f0..c228fbd 100644
---- a/surf.1
-+++ b/surf.1
-_AT_@ -32,6 +32,9 @@ Reparents to window specified by
- .B \-i
- Disable Images
- .TP
-+.B \-k
-+Enable kiosk mode (disable key stokes and right click)
-+.TP
- .B \-n
- Disable the Web Inspector (Developer Tools).
- .TP
-diff --git a/surf.c b/surf.c
-index 214b9c7..37db29a 100644
---- a/surf.c
-+++ b/surf.c
-_AT_@ -644,7 +644,8 @@ newclient(void) {
- g_signal_connect(G_OBJECT(c->win),
- "destroy",
- G_CALLBACK(destroywin), c);
-- g_signal_connect(G_OBJECT(c->win),
-+ if (!kioskmode)
-+ g_signal_connect(G_OBJECT(c->win),
- "key-press-event",
- G_CALLBACK(keypress), c);
-
-_AT_@ -748,6 +749,8 @@ newclient(void) {
- enablespatialbrowsing, NULL);
- g_object_set(G_OBJECT(settings), "enable-developer-extras",
- enableinspector, NULL);
-+ g_object_set(G_OBJECT(settings), "enable-default-context-menu",
-+ kioskmode ^ 1, NULL);
-
- if(enableinspector) {
- c->inspector = WEBKIT_WEB_INSPECTOR(
-_AT_@ -790,7 +793,7 @@ newclient(void) {
- static void
- newwindow(Client *c, const Arg *arg, gboolean noembed) {
- guint i = 0;
-- const char *cmd[11], *uri;
-+ const char *cmd[12], *uri;
- const Arg a = { .v = (void *)cmd };
- char tmp[64];
-
-_AT_@ -804,6 +807,8 @@ newwindow(Client *c, const Arg *arg, gboolean noembed) {
- }
- if(!loadimages)
- cmd[i++] = "-i";
-+ if(!kioskmode)
-+ cmd[i++] = "-k";
- if(!enableplugins)
- cmd[i++] = "-p";
- if(!enablescripts)
-_AT_@ -1180,7 +1185,7 @@ updatewinid(Client *c) {
-
- static void
- usage(void) {
-- die("usage: %s [-binpsvx] [-c cookiefile] [-e xid] [-r scriptfile]"
-+ die("usage: %s [-biknpsvx] [-c cookiefile] [-e xid] [-r scriptfile]"
- " [-t stylefile] [-u useragent] [uri]
", basename(argv0));
- }
-
-_AT_@ -1226,6 +1231,9 @@ main(int argc, char *argv[]) {
- case 'i':
- loadimages = 0;
- break;
-+ case 'k':
-+ kioskmode = 1;
-+ break;
- case 'n':
- enableinspector = 0;
- break;
Received on Mon Mar 11 2013 - 21:30:25 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 11 2013 - 21:36:19 CET