[Spice-devel] [PATCH spice-gtk v3 3/6] gtk: Use gdk_device_warp

Victor Toso victortoso at redhat.com
Mon Jan 23 13:34:50 UTC 2017


Hi,

On Fri, Jan 20, 2017 at 04:53:50PM +0100, Pavel Grunt wrote:
> gdk_display_warp_pointer has been deprecated since Gtk 3.0

Acked-by: Victor Toso <victortoso at redhat.com>

> ---
>  src/spice-widget.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index c8ee4bb..94d7f9a 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -119,6 +119,7 @@ static void release_keys(SpiceDisplay *display);
>  static void size_allocate(GtkWidget *widget, GtkAllocation *conf, gpointer data);
>  static gboolean draw_event(GtkWidget *widget, cairo_t *cr, gpointer data);
>  static void update_size_request(SpiceDisplay *display);
> +static GdkDevice *spice_display_get_pointer(SpiceDisplay *display);
>  
>  /* ---------------------------------------------------------------- */
>  
> @@ -1115,11 +1116,7 @@ static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion)
>          /* FIXME: we try our best to ignore that next pointer move event.. */
>          gdk_display_sync(gdk_screen_get_display(screen));
>  
> -        /* FIXME: gdk_display_warp_pointer() is deprecated */
> -        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
> -        gdk_display_warp_pointer(gtk_widget_get_display(GTK_WIDGET(display)),
> -                                 screen, xr, yr);
> -        G_GNUC_END_IGNORE_DEPRECATIONS
> +        gdk_device_warp(spice_display_get_pointer(display), screen, xr, yr);
>          d->mouse_last_x = -1;
>          d->mouse_last_y = -1;
>      }
> @@ -1155,9 +1152,9 @@ static void try_mouse_ungrab(SpiceDisplay *display)
>                                 y + d->mouse_guest_y * s,
>                                 &x, &y);
>  
> -    gdk_display_warp_pointer(gtk_widget_get_display(GTK_WIDGET(display)),
> -                             gtk_widget_get_screen(GTK_WIDGET(display)),
> -                             x, y);
> +    gdk_device_warp(spice_display_get_pointer(display),
> +                    gtk_widget_get_screen(GTK_WIDGET(display)),
> +                    x, y);
>  
>      g_signal_emit(display, signals[SPICE_DISPLAY_MOUSE_GRAB], 0, false);
>      spice_gtk_session_set_pointer_grabbed(d->gtk_session, false);
> -- 
> 2.11.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170123/65b9119e/attachment.sig>


More information about the Spice-devel mailing list