qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] SDL2: only show consoles by shortcuts and n


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1/2] SDL2: only show consoles by shortcuts and not hide.
Date: Wed, 07 Sep 2016 13:27:38 +0200

On Di, 2016-08-23 at 23:36 +0300, Andrei Karas wrote:
> This fix issue with stuck keys in SDL2 if press one of shortcuts
> for show/hide consoles.

More detailed description please.  How exactly do you end up with stuck
keys?

>              win = ev->key.keysym.scancode - SDL_SCANCODE_1;
>              if (win < sdl2_num_outputs) {
> -                sdl2_console[win].hidden = !sdl2_console[win].hidden;
> -                if (sdl2_console[win].real_window) {
> -                    if (sdl2_console[win].hidden) {
> -                        SDL_HideWindow(sdl2_console[win].real_window);
> -                    } else {
> -                        SDL_ShowWindow(sdl2_console[win].real_window);
> +                if (sdl2_console[win].hidden == 1) {
> +                    sdl2_console[win].hidden = !sdl2_console[win].hidden;
> +                    if (sdl2_console[win].real_window) {
> +                        if (sdl2_console[win].hidden) {
> +                            SDL_HideWindow(sdl2_console[win].real_window);
> +                        } else {
> +                            SDL_ShowWindow(sdl2_console[win].real_window);
> +                        }
>                      }
> +                    gui_keysym = 1;
>                  }
> -                gui_keysym = 1;

So, the hotkey works only in case the window is hidden, so you can't
hide windows with the shortcut any more.  Is that intentional?  Why?

>      case SDL_WINDOWEVENT_CLOSE:
> -        if (!no_quit) {
> -            no_shutdown = 0;
> -            qemu_system_shutdown_request();
> +        if (scon->idx == 0) {
> +            if (!no_quit) {
> +                no_shutdown = 0;
> +                qemu_system_shutdown_request();
> +            }
> +        } else {
> +            scon->hidden = true;
> +            SDL_HideWindow(scon->real_window);

Ok, for all but the primary window it is indeed useful to simply hide
the window instead of exiting.  Seems to be independent from the stuck
keys issue though.  If so send this as separate patch please.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]