[gtk+] gdkoffscreenwindow: Don't crash when resetting cursor



commit 861c57e3043229e769a45d7349b6e71d99c752de
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 10 15:23:57 2012 +0100

    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 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 837cffb..e0c1a76 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -218,6 +218,13 @@ gdk_offscreen_window_reparent (GdkWindow *window,
 }
 
 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,
 	       double *offscreen_x, double *offscreen_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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]