[Spice-devel] [PATCH spice] client: Don't handle hotkeys while sticky alt is active

Alon Levy alevy at redhat.com
Fri Mar 11 05:54:46 PST 2011


On Fri, Mar 11, 2011 at 02:09:09PM +0100, Hans de Goede wrote:
> In some cases rhev-m changes the hotkey for releasing the mouse grab
> to ctrl + alt. This makes it impossible to send ctrl + alt + other-key
> to the guest, even when using sticky alt.
> 

ACK.

> What happens is:
> -press alt until sticky alt activates
> -release alt (but recorded state stays pressed due to sticky alt)
> -press ctrl
> -hotkey code sees ctrl+alt pressed, releases mouse grab
> -mouse grab release code does an unpress all -> end of sticky state.
> 
> This patch makes it possible to atleast send ctrl + alt + del (or other key)
> using sticky alt. Note: even with this patch it is still a bad idea to
> use ctrl + alt as hotkey combi.
> ---
>  client/application.cpp |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/client/application.cpp b/client/application.cpp
> index 3333b0c..90ad6e3 100644
> --- a/client/application.cpp
> +++ b/client/application.cpp
> @@ -1247,10 +1247,12 @@ void Application::on_key_down(RedKey key)
>          }
>      }
>  
> -    int command = get_hotkeys_commnad();
> -    if (command != APP_CMD_INVALID) {
> -        do_command(command);
> -        return;
> +    if (!_sticky_info.sticky_mode) {
> +        int command = get_hotkeys_commnad();
> +        if (command != APP_CMD_INVALID) {
> +            do_command(command);
> +            return;
> +        }
>      }
>  
>  #ifdef WIN32
> -- 
> 1.7.3.2
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list