* [Qemu-devel] [PATCH v2] gtk: implement -full-screen
@ 2013-06-10 18:04 Peter Wu
2013-06-10 19:09 ` Anthony Liguori
2013-06-11 11:24 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
0 siblings, 2 replies; 3+ messages in thread
From: Peter Wu @ 2013-06-10 18:04 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-trivial, qemu-devel
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>
---
include/ui/console.h | 2 +-
ui/gtk.c | 6 +++++-
vl.c | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 4307b5f..f1d79f9 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -339,6 +339,6 @@ int index_from_keycode(int code);
/* gtk.c */
void early_gtk_display_init(void);
-void gtk_display_init(DisplayState *ds);
+void gtk_display_init(DisplayState *ds, bool full_screen);
#endif
diff --git a/ui/gtk.c b/ui/gtk.c
index 3bc2842..1c625c0 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1433,7 +1433,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;
@@ -1509,6 +1509,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;
diff --git a/vl.c b/vl.c
index 47ab45d..cfd2d3e 100644
--- a/vl.c
+++ b/vl.c
@@ -4347,7 +4347,7 @@ int main(int argc, char **argv, char **envp)
#endif
#if defined(CONFIG_GTK)
case DT_GTK:
- gtk_display_init(ds);
+ gtk_display_init(ds, full_screen);
break;
#endif
default:
--
1.8.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] gtk: implement -full-screen
2013-06-10 18:04 [Qemu-devel] [PATCH v2] gtk: implement -full-screen Peter Wu
@ 2013-06-10 19:09 ` Anthony Liguori
2013-06-11 11:24 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2013-06-10 19:09 UTC (permalink / raw)
To: Peter Wu; +Cc: qemu-trivial, qemu-devel
Peter Wu <lekensteyn@gmail.com> writes:
> 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>
Regards,
Anthony Liguori
> ---
> include/ui/console.h | 2 +-
> ui/gtk.c | 6 +++++-
> vl.c | 2 +-
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/include/ui/console.h b/include/ui/console.h
> index 4307b5f..f1d79f9 100644
> --- a/include/ui/console.h
> +++ b/include/ui/console.h
> @@ -339,6 +339,6 @@ int index_from_keycode(int code);
>
> /* gtk.c */
> void early_gtk_display_init(void);
> -void gtk_display_init(DisplayState *ds);
> +void gtk_display_init(DisplayState *ds, bool full_screen);
>
> #endif
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 3bc2842..1c625c0 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -1433,7 +1433,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;
> @@ -1509,6 +1509,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;
> diff --git a/vl.c b/vl.c
> index 47ab45d..cfd2d3e 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4347,7 +4347,7 @@ int main(int argc, char **argv, char **envp)
> #endif
> #if defined(CONFIG_GTK)
> case DT_GTK:
> - gtk_display_init(ds);
> + gtk_display_init(ds, full_screen);
> break;
> #endif
> default:
> --
> 1.8.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] gtk: implement -full-screen
2013-06-10 18:04 [Qemu-devel] [PATCH v2] gtk: implement -full-screen Peter Wu
2013-06-10 19:09 ` Anthony Liguori
@ 2013-06-11 11:24 ` Michael Tokarev
1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2013-06-11 11:24 UTC (permalink / raw)
To: Peter Wu; +Cc: qemu-trivial, Anthony Liguori, qemu-devel
10.06.2013 22:04, Peter Wu wrote:
> 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.
Thanks, applied to the trivial-patches queue.
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-11 11:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 18:04 [Qemu-devel] [PATCH v2] gtk: implement -full-screen Peter Wu
2013-06-10 19:09 ` Anthony Liguori
2013-06-11 11:24 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.