From 861c57e3043229e769a45d7349b6e71d99c752de Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 10 May 2012 15:23:57 +0100 Subject: [PATCH] gdkoffscreenwindow: Don't crash when resetting cursor When the toplevel is a GdkOffscreenWindow which doesn't implement the set_device_cursor() vfunc, we would have crashed. Implement a dummy ->set_device_cursor vfunc. https://bugzilla.gnome.org/show_bug.cgi?id=675809 --- gdk/gdkoffscreenwindow.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c index 837cffbea2..e0c1a76200 100644 --- a/gdk/gdkoffscreenwindow.c +++ b/gdk/gdkoffscreenwindow.c @@ -217,6 +217,13 @@ gdk_offscreen_window_reparent (GdkWindow *window, return was_mapped; } +static void +gdk_window_set_device_cursor (GdkWindow *window, + GdkDevice *device, + GdkCursor *cursor) +{ +} + static void from_embedder (GdkWindow *window, double embedder_x, double embedder_y, @@ -727,7 +734,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass) impl_class->move_resize = gdk_offscreen_window_move_resize; impl_class->set_background = gdk_offscreen_window_set_background; impl_class->reparent = gdk_offscreen_window_reparent; - impl_class->set_device_cursor = NULL; + impl_class->set_device_cursor = gdk_offscreen_window_set_device_cursor; impl_class->get_geometry = gdk_offscreen_window_get_geometry; impl_class->get_root_coords = gdk_offscreen_window_get_root_coords; impl_class->get_device_state = gdk_offscreen_window_get_device_state;