[libegg] egg-editable-toolbar: set a device to synthetic events
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libegg] egg-editable-toolbar: set a device to synthetic events
- Date: Sun, 3 Apr 2011 15:41:07 +0000 (UTC)
commit 44abd2452487a351175e47366039bccc0886d3eb
Author: Xan Lopez <xlopez igalia com>
Date: Sun Apr 3 08:40:14 2011 -0700
egg-editable-toolbar: set a device to synthetic events
GTK+ requires this now.
Bug #645228
libegg/toolbareditor/egg-editable-toolbar.c | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/libegg/toolbareditor/egg-editable-toolbar.c b/libegg/toolbareditor/egg-editable-toolbar.c
index 1a756fc..6a686bd 100644
--- a/libegg/toolbareditor/egg-editable-toolbar.c
+++ b/libegg/toolbareditor/egg-editable-toolbar.c
@@ -296,17 +296,18 @@ move_item_cb (GtkAction *action,
GtkTargetList *list = gtk_target_list_new (dest_drag_types, G_N_ELEMENTS (dest_drag_types));
GdkEvent *realevent = gtk_get_current_event();
- GdkEventMotion event;
- event.type = GDK_MOTION_NOTIFY;
- event.window = realevent->any.window;
- event.send_event = FALSE;
- event.axes = NULL;
- event.time = gdk_event_get_time (realevent);
- gdk_event_get_state (realevent, &event.state);
- gdk_event_get_coords (realevent, &event.x, &event.y);
- gdk_event_get_root_coords (realevent, &event.x_root, &event.y_root);
-
- gtk_drag_begin (toolitem, list, GDK_ACTION_MOVE, 1, (GdkEvent *)&event);
+ GdkEvent *event = gdk_event_new (GDK_MOTION_NOTIFY);
+ event->motion.window = g_object_ref (realevent->any.window);
+ event->motion.send_event = FALSE;
+ event->motion.axes = NULL;
+ event->motion.time = gdk_event_get_time (realevent);
+ gdk_event_set_device (event, gdk_event_get_device (realevent));
+ gdk_event_get_state (realevent, &event->motion.state);
+ gdk_event_get_coords (realevent, &event->motion.x, &event->motion.y);
+ gdk_event_get_root_coords (realevent, &event->motion.x_root, &event->motion.y_root);
+
+ gtk_drag_begin (toolitem, list, GDK_ACTION_MOVE, 1, event);
+ gdk_event_free (event);
gtk_target_list_unref (list);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]