From 787ba4f026f54d4fc7787078b896f9c5432c9a9b Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 10 Jun 2013 20:04:43 +0200 Subject: gtk: implement -full-screen Aiming for GTK as replacement for SDL, a feature like -full-screen should also be implemented. Bringing the window into full-screen mode is done by activating the "Fullscreen" menu item. This is done after showing the windows to make the cursor and menu hidden. v2: drop -no-frame implementation, use booleans instead of ints and ensure consistency between ui state and menu. Signed-off-by: Peter Wu Reviewed-by: Anthony Liguori Signed-off-by: Michael Tokarev --- ui/gtk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ui/gtk.c') diff --git a/ui/gtk.c b/ui/gtk.c index 63f6081913..e314dba343 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1435,7 +1435,7 @@ static const DisplayChangeListenerOps dcl_ops = { .dpy_cursor_define = gd_cursor_define, }; -void gtk_display_init(DisplayState *ds) +void gtk_display_init(DisplayState *ds, bool full_screen) { GtkDisplayState *s = g_malloc0(sizeof(*s)); char *filename; @@ -1511,6 +1511,10 @@ void gtk_display_init(DisplayState *ds) gtk_widget_show_all(s->window); + if (full_screen) { + gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item)); + } + register_displaychangelistener(&s->dcl); global_state = s; -- cgit v1.2.3