summaryrefslogtreecommitdiff
path: root/network/surf/patches/startfullscreen.diff
blob: 45e1f87f531ad79cd4285d1c1ce2e25b203c33b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
diff -Naur surf-0.6/surf.1 surf-0.6.patched/surf.1
--- surf-0.6/surf.1	2013-02-10 13:40:14.000000000 -0500
+++ surf-0.6.patched/surf.1	2013-07-03 18:41:35.000000000 -0400
@@ -50,6 +50,8 @@
 .B \-x
 Prints xid to standard output. This can be used to script the browser by using
 .BR xprop(1).
+.B \-f
+Start in fullscreen mode.
 .SH USAGE
 .B Escape
 Stops loading current page or stops download.
diff -Naur surf-0.6/surf.c surf-0.6.patched/surf.c
--- surf-0.6/surf.c	2013-02-10 13:40:14.000000000 -0500
+++ surf-0.6.patched/surf.c	2013-07-03 18:42:07.000000000 -0400
@@ -81,6 +81,7 @@
 static Client *clients = NULL;
 static GdkNativeWindow embed = 0;
 static gboolean showxid = FALSE;
+static gboolean startfullscreen = FALSE;
 static char winid[64];
 static gboolean usingproxy = 0;
 static char togglestat[5];
@@ -463,7 +464,7 @@
 	} else {
 		gtk_window_fullscreen(GTK_WINDOW(c->win));
 	}
-	c->fullscreen = !c->fullscreen;
+	startfullscreen = c->fullscreen = !c->fullscreen;
 }
 
 static const char *
@@ -822,6 +823,9 @@
                 }
 	}
 
+	if(startfullscreen) {
+		fullscreen(c, NULL);
+	}
 	return c;
 }
 
@@ -846,6 +850,8 @@
 		cmd[i++] = "-i";
 	if(showxid)
 		cmd[i++] = "-x";
+	if(startfullscreen)
+		cmd[i++] = "-f";
 	cmd[i++] = "--";
 	uri = arg->v ? (char *)arg->v : c->linkhover;
 	if(uri)
@@ -1148,7 +1154,7 @@
 
 static void
 usage(void) {
-	die("usage: %s [-inpsvx] [-c cookiefile] [-e xid] [-r scriptfile]"
+	die("usage: %s [-inpsvxf] [-c cookiefile] [-e xid] [-r scriptfile]"
 		" [-t stylefile] [-u useragent] [uri]\n", basename(argv0));
 }
 
@@ -1215,6 +1221,9 @@
 	case 'x':
 		showxid = TRUE;
 		break;
+	case 'f':
+		startfullscreen = TRUE;
+		break;
 	default:
 		usage();
 	} ARGEND;