pidgin/plugins/gestures/stroke-draw.c

changeset 33270
a6493d38dc28
parent 33170
ce4447562d64
child 35541
12bd3807140b
--- a/pidgin/plugins/gestures/stroke-draw.c	Tue Aug 14 23:30:10 2012 -0400
+++ b/pidgin/plugins/gestures/stroke-draw.c	Wed Aug 15 03:12:27 2012 -0400
@@ -119,8 +119,11 @@
 	timer_id = 0;
 
 	if( event != NULL )
+#if GTK_CHECK_VERSION(3,0,0)
+		gdk_device_ungrab(gdk_event_get_device(event), event->button.time);
+#else
 		gdk_pointer_ungrab (event->button.time);
-
+#endif
 
 	if (gstroke_draw_strokes() && gstroke_disp != NULL) {
 	    /* get rid of the invisible stroke window */
@@ -158,9 +161,16 @@
 	  if (cursor == NULL)
 		  cursor = gdk_cursor_new(GDK_PENCIL);
 
+#if GTK_CHECK_VERSION(3,0,0)
+      gdk_device_grab(gdk_event_get_device(event),
+                      gtk_widget_get_window(widget), GDK_OWNERSHIP_WINDOW,
+                      FALSE, GDK_BUTTON_RELEASE_MASK, cursor,
+                      event->button.time);
+#else
       gdk_pointer_grab (gtk_widget_get_window(widget), FALSE,
 			GDK_BUTTON_RELEASE_MASK, NULL, cursor,
 			event->button.time);
+#endif
       timer_id = g_timeout_add (GSTROKE_TIMEOUT_DURATION,
 				  gstroke_timeout, widget);
       return TRUE;
@@ -179,7 +189,11 @@
       last_mouse_position.invalid = TRUE;
       original_widget = NULL;
       g_source_remove (timer_id);
+#if GTK_CHECK_VERSION(3,0,0)
+      gdk_device_ungrab(gdk_event_get_device(event), event->button.time);
+#else
       gdk_pointer_ungrab (event->button.time);
+#endif
       timer_id = 0;
 
       {

mercurial