[evolution/wip/webkit2] [libgnomecanvas] Drag end not recognized with gtk+ 3.18.x
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] [libgnomecanvas] Drag end not recognized with gtk+ 3.18.x
- Date: Wed, 2 Mar 2016 15:20:12 +0000 (UTC)
commit 3ad594f35ed1fa51a321fab8905a02e68d7feb26
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 11 11:51:39 2015 +0100
[libgnomecanvas] Drag end not recognized with gtk+ 3.18.x
The gtk+ used to emit a fake button-released event, which had been
used to recognize when the drag ended. This signal emission had been
removed as a fix for bug #749737, but the code in the libgnomecanvas
was not adapted.
libgnomecanvas/gnome-canvas.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 4d482c5..fecce97 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -1725,6 +1725,8 @@ static void gnome_canvas_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gnome_canvas_draw (GtkWidget *widget,
cairo_t *cr);
+static void gnome_canvas_drag_end (GtkWidget *widget,
+ GdkDragContext *context);
static gint gnome_canvas_button (GtkWidget *widget,
GdkEventButton *event);
static gint gnome_canvas_motion (GtkWidget *widget,
@@ -1874,6 +1876,7 @@ gnome_canvas_class_init (GnomeCanvasClass *class)
widget_class->unrealize = gnome_canvas_unrealize;
widget_class->size_allocate = gnome_canvas_size_allocate;
widget_class->draw = gnome_canvas_draw;
+ widget_class->drag_end = gnome_canvas_drag_end;
widget_class->button_press_event = gnome_canvas_button;
widget_class->button_release_event = gnome_canvas_button;
widget_class->motion_notify_event = gnome_canvas_motion;
@@ -2320,6 +2323,20 @@ gnome_canvas_draw (GtkWidget *widget,
return FALSE;
}
+static void
+gnome_canvas_drag_end (GtkWidget *widget,
+ GdkDragContext *context)
+{
+ GnomeCanvas *canvas = GNOME_CANVAS (widget);
+
+ if (canvas->grabbed_item) {
+ gnome_canvas_item_ungrab (canvas->grabbed_item, GDK_CURRENT_TIME);
+ }
+
+ if (GTK_WIDGET_CLASS (gnome_canvas_parent_class)->drag_end)
+ GTK_WIDGET_CLASS (gnome_canvas_parent_class)->drag_end (widget, context);
+}
+
/* Emits an event for an item in the canvas, be it the current item, grabbed
* item, or focused item, as appropriate.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]