mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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 <lekensteyn@gmail.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
b5601df762
commit
787ba4f026
3 changed files with 7 additions and 3 deletions
|
|
@ -339,6 +339,6 @@ int index_from_keycode(int code);
|
||||||
|
|
||||||
/* gtk.c */
|
/* gtk.c */
|
||||||
void early_gtk_display_init(void);
|
void early_gtk_display_init(void);
|
||||||
void gtk_display_init(DisplayState *ds);
|
void gtk_display_init(DisplayState *ds, bool full_screen);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
6
ui/gtk.c
6
ui/gtk.c
|
|
@ -1435,7 +1435,7 @@ static const DisplayChangeListenerOps dcl_ops = {
|
||||||
.dpy_cursor_define = gd_cursor_define,
|
.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));
|
GtkDisplayState *s = g_malloc0(sizeof(*s));
|
||||||
char *filename;
|
char *filename;
|
||||||
|
|
@ -1511,6 +1511,10 @@ void gtk_display_init(DisplayState *ds)
|
||||||
|
|
||||||
gtk_widget_show_all(s->window);
|
gtk_widget_show_all(s->window);
|
||||||
|
|
||||||
|
if (full_screen) {
|
||||||
|
gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
|
||||||
|
}
|
||||||
|
|
||||||
register_displaychangelistener(&s->dcl);
|
register_displaychangelistener(&s->dcl);
|
||||||
|
|
||||||
global_state = s;
|
global_state = s;
|
||||||
|
|
|
||||||
2
vl.c
2
vl.c
|
|
@ -4348,7 +4348,7 @@ int main(int argc, char **argv, char **envp)
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_GTK)
|
#if defined(CONFIG_GTK)
|
||||||
case DT_GTK:
|
case DT_GTK:
|
||||||
gtk_display_init(ds);
|
gtk_display_init(ds, full_screen);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue