[PATCH libinput] tools: don't use deprecated gdk_cursor_new()

Hans de Goede hdegoede at redhat.com
Wed Mar 18 01:30:49 PDT 2015


Hi,

On 18-03-15 00:44, Peter Hutterer wrote:
> Replaced by gdk_cursor_new_from_display() which means we need to tickle the
> event until it spits out a GdkDisplay.
>
> Deprecated in gdk 3.16
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Looks good to me:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

> ---
> If anyone can do a quick double-check that I'm not mis-using gdk here please
> that'd be appreciated.


I cannot comment on this, as I'm in no way a gdk expert.

Regards,

Hans

>
>   tools/event-gui.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tools/event-gui.c b/tools/event-gui.c
> index 85c5ab1..75e4e19 100644
> --- a/tools/event-gui.c
> +++ b/tools/event-gui.c
> @@ -172,6 +172,8 @@ static void
>   map_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
>   {
>   	struct window *w = data;
> +	GdkDisplay *display;
> +	GdkWindow *window;
>
>   	gtk_window_get_size(GTK_WINDOW(widget), &w->width, &w->height);
>
> @@ -185,8 +187,12 @@ map_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
>
>   	g_signal_connect(G_OBJECT(w->area), "draw", G_CALLBACK(draw), w);
>
> +	window = gdk_event_get_window(event);
> +	display = gdk_window_get_display(window);
> +
>   	gdk_window_set_cursor(gtk_widget_get_window(w->win),
> -			      gdk_cursor_new(GDK_BLANK_CURSOR));
> +			      gdk_cursor_new_for_display(display,
> +							 GDK_BLANK_CURSOR));
>   }
>
>   static void
>


More information about the wayland-devel mailing list