[Spice-devel,spice-gtk] do not eat ungrab key-sequence

Submitted by Marc-André Lureau on May 17, 2012, 9:42 p.m.

Details

Message ID 1337290948-4570-1-git-send-email-marcandre.lureau@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Marc-André Lureau May 17, 2012, 9:42 p.m.
The remote may want to use that same key sequence,
so we better send it through, even if it matches
the ungrab key combination.
---
 gtk/spice-widget.c |    2 --
 1 file changed, 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index e6c252d..fad9db5 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -979,8 +979,6 @@  static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
             else
                 try_mouse_grab(display);
         }
-
-        return true;
     }
 
     if (!d->inputs)

Comments

Hi,

On 05/17/2012 11:42 PM, Marc-André Lureau wrote:
> The remote may want to use that same key sequence,
> so we better send it through, even if it matches
> the ungrab key combination.

I'm not sure about this, if the grab-sequence is
getting in the way, maybe we need a different
grab-sequence?

What about only letting it through when in client mouse
mode, ie when it does not do anything wrt the client's
behavior?

Regards,

Hans


> ---
>   gtk/spice-widget.c |    2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index e6c252d..fad9db5 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -979,8 +979,6 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
>               else
>                   try_mouse_grab(display);
>           }
> -
> -        return true;
>       }
>
>       if (!d->inputs)
----- Mensaje original -----
> Hi,
> 
> On 05/17/2012 11:42 PM, Marc-André Lureau wrote:
> > The remote may want to use that same key sequence,
> > so we better send it through, even if it matches
> > the ungrab key combination.
> 
> I'm not sure about this, if the grab-sequence is
> getting in the way, maybe we need a different
> grab-sequence?

It's already configurable.

Well, the advantage of using modifiers key for
grab-sequence is that the side of effect is limited.
In general ctrl+alt alone won't do anything on its own
(that's why I think it was a good candidate)

However, it still is better to send those modifiers
to the guest, even if they match the grab sequence.

> What about only letting it through when in client mouse
> mode, ie when it does not do anything wrt the client's
> behavior?

I am afraid we have too many cases with server mouse mode,
(for some reasons people don't use usb-tablet or the agent
is malfunctioning, for example, on windows) so this it not
an option.
Hi,

On 05/18/2012 01:21 PM, Marc-André Lureau wrote:
>
>
> ----- Mensaje original -----
>> Hi,
>>
>> On 05/17/2012 11:42 PM, Marc-André Lureau wrote:
>>> The remote may want to use that same key sequence,
>>> so we better send it through, even if it matches
>>> the ungrab key combination.
>>
>> I'm not sure about this, if the grab-sequence is
>> getting in the way, maybe we need a different
>> grab-sequence?
>
> It's already configurable.
>
> Well, the advantage of using modifiers key for
> grab-sequence is that the side of effect is limited.
> In general ctrl+alt alone won't do anything on its own
> (that's why I think it was a good candidate)
>
> However, it still is better to send those modifiers
> to the guest, even if they match the grab sequence.

Agreed, for modifiers, but what if the key binding
is changed to shift+F12 as rhev does? Then I'm not sure
sending the key events to the guest is desirable ...

Regards,

Hans
Hi

> Agreed, for modifiers, but what if the key binding
> is changed to shift+F12 as rhev does? Then I'm not sure
> sending the key events to the guest is desirable ...

what if we make this configurable, and default to
non-passthrough? that will be up to the application to
change the behaviour depending on the key-sequence used.
Hi,

On 05/18/2012 02:15 PM, Marc-André Lureau wrote:
> Hi
>
>> Agreed, for modifiers, but what if the key binding
>> is changed to shift+F12 as rhev does? Then I'm not sure
>> sending the key events to the guest is desirable ...
>
> what if we make this configurable, and default to
> non-passthrough? that will be up to the application to
> change the behaviour depending on the key-sequence used.

I could live with that, note I could even live with your
original patch I'm just not *sure* it is a good idea.

 From the same book ("not sure it is a good idea"), I'm
not really sure we should add yet another configurable
setting... How about passing the key event through if
it is a modifier key, and not if it is a regular key?

Regards,

Hans
----- Mensaje original -----
>  From the same book ("not sure it is a good idea"), I'm
> not really sure we should add yet another configurable
> setting... How about passing the key event through if
> it is a modifier key, and not if it is a regular key?

ack, that should be simple I'll prepare a patch.