From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhb15-0008LS-Js for qemu-devel@nongnu.org; Wed, 07 Sep 2016 07:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhb12-0007wX-EN for qemu-devel@nongnu.org; Wed, 07 Sep 2016 07:27:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhb12-0007wT-8y for qemu-devel@nongnu.org; Wed, 07 Sep 2016 07:27:40 -0400 Message-ID: <1473247658.28663.61.camel@redhat.com> From: Gerd Hoffmann Date: Wed, 07 Sep 2016 13:27:38 +0200 In-Reply-To: <1471984582.966257043@f45.i.mail.ru> References: <1471984582.966257043@f45.i.mail.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] SDL2: only show consoles by shortcuts and not hide. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrei Karas Cc: qemu-devel 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 =3D ev->key.keysym.scancode - SDL_SCANCODE_1; > if (win < sdl2_num_outputs) { > - sdl2_console[win].hidden =3D !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 =3D=3D 1) { > + sdl2_console[win].hidden =3D !sdl2_console[win].hidd= en; > + 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 =3D 1; > } > - gui_keysym =3D 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 =3D 0; > - qemu_system_shutdown_request(); > + if (scon->idx =3D=3D 0) { > + if (!no_quit) { > + no_shutdown =3D 0; > + qemu_system_shutdown_request(); > + } > + } else { > + scon->hidden =3D 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