[Spice-devel] [PATCH spice-gtk] RFC: release pointer grab on grab-broken

Marc-André Lureau marcandre.lureau at gmail.com
Wed Mar 27 05:41:34 PDT 2013


On Wed, Mar 27, 2013 at 11:54 AM, Hans de Goede <hdegoede at redhat.com> wrote:
> I would like to see the above block changed to:
>
>      if (event->keyboard) {
>         try_keyboard_ungrab(self);
>         try_mouse_ungrab(self);
>      } else {
>
> This should also fix the issue you're trying to fix. With the added
> advantage that it will release the mouse even if for some reason
> d->keyboard_grab_active is false when we get the grab_broken.

That's what I did first (minus the fact that we don't need the else block)


>> -        d->mouse_grab_active = false;
>> -        g_signal_emit(self, signals[SPICE_DISPLAY_MOUSE_GRAB], 0, false);
>> +        try_mouse_ungrab(self);
>>       }
>>
>>       return false;
>> @@ -751,6 +749,9 @@ static void try_keyboard_ungrab(SpiceDisplay *display)
>>   #endif
>>       d->keyboard_grab_active = false;
>>       g_signal_emit(widget, signals[SPICE_DISPLAY_KEYBOARD_GRAB], 0,
>> false);
>> +
>> +    /* for consistency, there should not be only a mouse grab */
>> +    try_mouse_ungrab(display);
>>   }

But here was my reasoning: there should never be only a mouse grab.



-- 
Marc-André Lureau


More information about the Spice-devel mailing list