[Spice-devel] [PATCH spice-gtk 09/10] spice-widget: remove keyboard_grab_count / keyboard_grab_time hack

Christophe Fergeau cfergeau at redhat.com
Wed Aug 17 08:48:03 PDT 2011


Yep, sounds good too

Christophe

On Fri, Aug 12, 2011 at 04:50:36PM +0200, Hans de Goede wrote:
> With the filtering of focus in / out events caused by grabs we should no
> longer need this.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/spice-widget-priv.h |    2 --
>  gtk/spice-widget.c      |   17 -----------------
>  2 files changed, 0 insertions(+), 19 deletions(-)
> 
> diff --git a/gtk/spice-widget-priv.h b/gtk/spice-widget-priv.h
> index 5527ebc..bd6dedb 100644
> --- a/gtk/spice-widget-priv.h
> +++ b/gtk/spice-widget-priv.h
> @@ -105,8 +105,6 @@ struct _SpiceDisplayPrivate {
>  
>      bool                    keyboard_grab_active;
>      bool                    keyboard_have_focus;
> -    int                     keyboard_grab_count;
> -    time_t                  keyboard_grab_time;
>  
>      const guint16 const     *keycode_map;
>      size_t                  keycode_maplen;
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 30036ce..7afc6eb 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -377,7 +377,6 @@ static void try_keyboard_grab(SpiceDisplay *display)
>  {
>      GtkWidget *widget = GTK_WIDGET(display);
>      SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
> -    time_t now;
>      GdkGrabStatus status;
>  
>      if (d->keyboard_grab_active)
> @@ -393,22 +392,6 @@ static void try_keyboard_grab(SpiceDisplay *display)
>      g_return_if_fail(gtk_widget_is_focus(widget));
>      g_return_if_fail(gtk_widget_has_focus(widget));
>  
> -    /*
> -     * focus / keyboard grab behavior is funky sometime
> -     * when going fullscreen (with KDE and GNOME-shell):
> -     * focus-in-event -> grab -> focus-out-event -> ungrab -> repeat
> -     * I have no idea why the grab triggers focus-out :-(
> -     */
> -    now = time(NULL);
> -    if (d->keyboard_grab_time != now) {
> -        d->keyboard_grab_time = now;
> -        d->keyboard_grab_count = 0;
> -    }
> -    if (d->keyboard_grab_count++ > 32) {
> -        g_critical("32 grabs last second -> emergency exit");
> -        return;
> -    }
> -
>      SPICE_DEBUG("grab keyboard");
>  
>  #ifdef WIN32
> -- 
> 1.7.5.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110817/32887e0f/attachment-0001.pgp>


More information about the Spice-devel mailing list