summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2013-03-11 21:26:22 +0100
committerChristoph Lohmann <20h@r-36.net>2013-03-11 21:26:22 +0100
commitbadb84387e659ba1692c08f728ad6e7846d37818 (patch)
tree7ebcbddafb9843d378d20529691dbe344bc06996 /surf.c
parentfe3bd631d4e163e15ab685c22ad70c67f8b94f83 (diff)
downloadsurf-badb84387e659ba1692c08f728ad6e7846d37818.tar.gz
surf-badb84387e659ba1692c08f728ad6e7846d37818.tar.bz2
surf-badb84387e659ba1692c08f728ad6e7846d37818.zip
Adding kiosk mode.
Thanks to Christian Hesse <mail@eworm.de>!
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/surf.c b/surf.c
index 214b9c7..702eaf6 100644
--- a/surf.c
+++ b/surf.c
@@ -644,9 +644,11 @@ newclient(void) {
g_signal_connect(G_OBJECT(c->win),
"destroy",
G_CALLBACK(destroywin), c);
- g_signal_connect(G_OBJECT(c->win),
- "key-press-event",
- G_CALLBACK(keypress), c);
+ if(!kioskmode) {
+ g_signal_connect(G_OBJECT(c->win),
+ "key-press-event",
+ G_CALLBACK(keypress), c);
+ }
/* Pane */
c->pane = gtk_vpaned_new();
@@ -748,6 +750,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(
@@ -790,7 +794,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];
@@ -804,6 +808,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)
@@ -1180,7 +1186,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]\n", basename(argv0));
}
@@ -1226,6 +1232,9 @@ main(int argc, char *argv[]) {
case 'i':
loadimages = 0;
break;
+ case 'k':
+ kioskmode = 1;
+ break;
case 'n':
enableinspector = 0;
break;