summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-12-03 21:19:16 +0100
committerChristoph Lohmann <20h@r-36.net>2012-12-03 21:19:16 +0100
commit0dfdb75804315678fb22e9703b3e48f5c2b8e1cd (patch)
treee44e855dce9ec861d0305d225effa14551a2b692
parent1f30ddf22410c7c01487a84097ef485af4617c86 (diff)
downloadsurf-0dfdb75804315678fb22e9703b3e48f5c2b8e1cd.tar.gz
surf-0dfdb75804315678fb22e9703b3e48f5c2b8e1cd.tar.bz2
surf-0dfdb75804315678fb22e9703b3e48f5c2b8e1cd.zip
Implementing fullscreen mode. Thanks Krol, Willem van de!
-rw-r--r--TODO.md1
-rw-r--r--config.def.h1
-rw-r--r--surf.c13
3 files changed, 13 insertions, 2 deletions
diff --git a/TODO.md b/TODO.md
index 99312e1..6bb66c9 100644
--- a/TODO.md
+++ b/TODO.md
@@ -3,6 +3,5 @@
* suckless adblocking
* integrate the WebKitWebInspector API
* make scrollbars a switch and allow them to be disabled
-* implement fullscreen mode (F11)
* replace webkit with something sane
diff --git a/config.def.h b/config.def.h
index 4fd1292..789ada4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -66,6 +66,7 @@ static Key keys[] = {
{ MODKEY, GDK_i, scroll_h, { .i = +1 } },
{ MODKEY, GDK_u, scroll_h, { .i = -1 } },
+ { 0, GDK_F11, fullscreen, { 0 } },
{ 0, GDK_Escape, stop, { 0 } },
{ MODKEY, GDK_o, source, { 0 } },
diff --git a/surf.c b/surf.c
index a15ed00..b69c615 100644
--- a/surf.c
+++ b/surf.c
@@ -46,7 +46,7 @@ typedef struct Client {
gint progress;
gboolean sslfailed;
struct Client *next;
- gboolean zoomed;
+ gboolean zoomed, fullscreen;
} Client;
typedef struct {
@@ -101,6 +101,7 @@ static void die(char *str);
static void drawindicator(Client *c);
static gboolean exposeindicator(GtkWidget *w, GdkEventExpose *e, Client *c);
static void find(Client *c, const Arg *arg);
+static void fullscreen(Client *c, const Arg *arg);
static const char *getatom(Client *c, int a);
static char *geturi(Client *c);
static gboolean initdownload(WebKitWebView *v, WebKitDownload *o, Client *c);
@@ -399,6 +400,16 @@ find(Client *c, const Arg *arg) {
webkit_web_view_search_text(c->view, s, FALSE, forward, TRUE);
}
+void
+fullscreen(Client *c, const Arg *arg) {
+ if(c->fullscreen) {
+ gtk_window_unfullscreen(GTK_WINDOW(c->win));
+ } else {
+ gtk_window_fullscreen(GTK_WINDOW(c->win));
+ }
+ c->fullscreen = !c->fullscreen;
+}
+
const char *
getatom(Client *c, int a) {
static char buf[BUFSIZ];