qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ui/sdl2: Fix broken -full-screen CLI option
@ 2018-07-09 18:44 Thomas Huth
  2018-08-20 18:17 ` Thomas Huth
  2018-08-21  5:44 ` Gerd Hoffmann
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2018-07-09 18:44 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel

We've got to set the gui_fullscreen variable before creating the
SDL2 window, otherwise the initial window will not be created in
fullscreen mode.

Buglink: https://bugs.launchpad.net/bugs/1780812
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 ui/sdl2.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 76e5942..01571dc 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -792,6 +792,8 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
     memset(&info, 0, sizeof(info));
     SDL_VERSION(&info.version);
 
+    gui_fullscreen = o->has_full_screen && o->full_screen;
+
     for (i = 0;; i++) {
         QemuConsole *con = qemu_console_lookup_by_index(i);
         if (!con) {
@@ -844,17 +846,14 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
         g_free(filename);
     }
 
-    if (sdl2_console->opts->has_full_screen &&
-        sdl2_console->opts->full_screen) {
-        gui_fullscreen = 1;
+    gui_grab = 0;
+    if (gui_fullscreen) {
         sdl_grab_start(0);
     }
 
     mouse_mode_notifier.notify = sdl_mouse_mode_change;
     qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier);
 
-    gui_grab = 0;
-
     sdl_cursor_hidden = SDL_CreateCursor(&data, &data, 8, 1, 0, 0);
     sdl_cursor_normal = SDL_GetCursor();
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/sdl2: Fix broken -full-screen CLI option
  2018-07-09 18:44 [Qemu-devel] [PATCH] ui/sdl2: Fix broken -full-screen CLI option Thomas Huth
@ 2018-08-20 18:17 ` Thomas Huth
  2018-08-21  5:44 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2018-08-20 18:17 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel

On 2018-07-09 20:44, Thomas Huth wrote:
> We've got to set the gui_fullscreen variable before creating the
> SDL2 window, otherwise the initial window will not be created in
> fullscreen mode.
> 
> Buglink: https://bugs.launchpad.net/bugs/1780812
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  ui/sdl2.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/ui/sdl2.c b/ui/sdl2.c
> index 76e5942..01571dc 100644
> --- a/ui/sdl2.c
> +++ b/ui/sdl2.c
> @@ -792,6 +792,8 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
>      memset(&info, 0, sizeof(info));
>      SDL_VERSION(&info.version);
>  
> +    gui_fullscreen = o->has_full_screen && o->full_screen;
> +
>      for (i = 0;; i++) {
>          QemuConsole *con = qemu_console_lookup_by_index(i);
>          if (!con) {
> @@ -844,17 +846,14 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
>          g_free(filename);
>      }
>  
> -    if (sdl2_console->opts->has_full_screen &&
> -        sdl2_console->opts->full_screen) {
> -        gui_fullscreen = 1;
> +    gui_grab = 0;
> +    if (gui_fullscreen) {
>          sdl_grab_start(0);
>      }
>  
>      mouse_mode_notifier.notify = sdl_mouse_mode_change;
>      qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier);
>  
> -    gui_grab = 0;
> -
>      sdl_cursor_hidden = SDL_CreateCursor(&data, &data, 8, 1, 0, 0);
>      sdl_cursor_normal = SDL_GetCursor();
>  
> 

Ping?

 Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/sdl2: Fix broken -full-screen CLI option
  2018-07-09 18:44 [Qemu-devel] [PATCH] ui/sdl2: Fix broken -full-screen CLI option Thomas Huth
  2018-08-20 18:17 ` Thomas Huth
@ 2018-08-21  5:44 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2018-08-21  5:44 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel

On Mon, Jul 09, 2018 at 08:44:10PM +0200, Thomas Huth wrote:
> We've got to set the gui_fullscreen variable before creating the
> SDL2 window, otherwise the initial window will not be created in
> fullscreen mode.

Added to ui queue.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-21  5:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-09 18:44 [Qemu-devel] [PATCH] ui/sdl2: Fix broken -full-screen CLI option Thomas Huth
2018-08-20 18:17 ` Thomas Huth
2018-08-21  5:44 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).