aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-02-28 06:24:38 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-02-28 06:24:38 +0800
commit1de4b21c42204c218b86ca95f368b66d579d2962 (patch)
tree1f0af59b6e93f09f9199fd04bf030ec460ce4aad
parentc7db899624ec9b736bf58c9c6ef708e32b418966 (diff)
downloadgsoc2013-evolution-1de4b21c42204c218b86ca95f368b66d579d2962.tar.gz
gsoc2013-evolution-1de4b21c42204c218b86ca95f368b66d579d2962.tar.zst
gsoc2013-evolution-1de4b21c42204c218b86ca95f368b66d579d2962.zip
use gdk_event_copy and gdk_event_free to dup the event.
2003-02-27 Mike Kestner <mkestner@ximian.com> * gal/widgets/e-canvas.c (emit_event): use gdk_event_copy and gdk_event_free to dup the event. svn path=/trunk/; revision=20088
-rw-r--r--widgets/misc/e-canvas.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 54282f5408..1bbeef9a28 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -161,7 +161,7 @@ e_canvas_new ()
static int
emit_event (GnomeCanvas *canvas, GdkEvent *event)
{
- GdkEvent ev;
+ GdkEvent *ev;
gint finished;
GnomeCanvasItem *item;
GnomeCanvasItem *parent;
@@ -225,14 +225,14 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
* offsets of the fields in the event structures.
*/
- ev = *event;
+ ev = gdk_event_copy (event);
- switch (ev.type) {
+ switch (ev->type) {
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
gnome_canvas_window_to_world (canvas,
- ev.crossing.x, ev.crossing.y,
- &ev.crossing.x, &ev.crossing.y);
+ ev->crossing.x, ev->crossing.y,
+ &ev->crossing.x, &ev->crossing.y);
break;
case GDK_MOTION_NOTIFY:
@@ -241,8 +241,8 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
gnome_canvas_window_to_world (canvas,
- ev.motion.x, ev.motion.y,
- &ev.motion.x, &ev.motion.y);
+ ev->motion.x, ev->motion.y,
+ &ev->motion.x, &ev->motion.y);
break;
default:
@@ -259,17 +259,7 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
while (item && !finished) {
g_object_ref (item);
- g_signal_emit_by_name (item, "event",
- &ev,
- &finished);
-
-#ifndef NO_WARNINGS
-#warning FIXME - needs thought
-#endif
-#if 0
- if (GTK_OBJECT_DESTROYED (item))
- finished = TRUE;
-#endif
+ g_signal_emit_by_name (item, "event", ev, &finished);
parent = item->parent;
g_object_unref (item);
@@ -277,6 +267,8 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
item = parent;
}
+ gdk_event_free (ev);
+
return finished;
}
@@ -696,8 +688,8 @@ e_canvas_style_set (GtkWidget *widget, GtkStyle *previous_style)
static void
e_canvas_realize (GtkWidget *widget)
{
- gint width, height;
#ifdef GAL_GDK_IM
+ gint width, height;
ECanvas *ecanvas = E_CANVAS (widget);
#endif