summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee512cd)
raw | patch | inline | side by side (parent: ee512cd)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 8 Dec 2011 07:10:58 +0000 (08:10 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 8 Dec 2011 07:10:58 +0000 (08:10 +0100) |
src/tpdfview.c | patch | blob | history |
diff --git a/src/tpdfview.c b/src/tpdfview.c
index 0d3755958a800a9bb511ccacde5ef3e02678a2e2..b98332d178032382ac7bfb9fccf30ab9cb474073 100644 (file)
--- a/src/tpdfview.c
+++ b/src/tpdfview.c
exit(0);
} /* exit_version */
+static void
+toggle_fullscreen(GtkWindow *win)
+{
+ GdkWindowState state;
+
+ if (! gtk_widget_get_realized(GTK_WIDGET(win)))
+ return;
+
+ state = gdk_window_get_state(GTK_WIDGET(win)->window);
+
+ if (state & GDK_WINDOW_STATE_FULLSCREEN)
+ gtk_window_unfullscreen(win);
+ else
+ gtk_window_fullscreen(win);
+} /* toggle_fullscreen */
+
static void
on_destroy(GtkWidget __attribute__((unused)) *widget,
gpointer __attribute__((unused)) data)
} /* on_destroy */
static gboolean
-key_press(GtkWidget __attribute__((unused)) *widget,
- GdkEventKey *event, gpointer data)
+key_press(GtkWidget *window, GdkEventKey *event, gpointer data)
{
GtkWidget *tpdfv;
gtk_tpdfv_reload(tpdfv);
break;
+ case GDK_F:
+ toggle_fullscreen(GTK_WINDOW(window));
+ break;
+
/* navigation */
case GDK_Page_Up:
gtk_tpdfv_page_up(tpdfv);