aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-canvas.c20
-rw-r--r--widgets/misc/e-canvas.c20
3 files changed, 21 insertions, 24 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index c1eccd6f0f..e17f53ff4b 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,8 @@
+2000-09-07 Federico Mena Quintero <federico@helixcode.com>
+
+ * e-canvas.c (emit_event): Remove incorrect optimization. Events
+ are read-only!
+
2000-09-04 Lauris Kaplinski <lauris@helixcode.com>
* e-unicode.c: Added new font code, but comment it out now
diff --git a/e-util/e-canvas.c b/e-util/e-canvas.c
index fb67bf0379..83f276e1f6 100644
--- a/e-util/e-canvas.c
+++ b/e-util/e-canvas.c
@@ -149,7 +149,7 @@ is_descendant (GnomeCanvasItem *item, GnomeCanvasItem *parent)
static int
emit_event (GnomeCanvas *canvas, GdkEvent *event)
{
- /*GdkEvent ev;*/
+ GdkEvent ev;
gint finished;
GnomeCanvasItem *item;
GnomeCanvasItem *parent;
@@ -205,16 +205,14 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
* offsets of the fields in the event structures.
*/
- /*ev = *event;*/
+ ev = *event;
- switch (event->type) {
+ switch (ev.type) {
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
gnome_canvas_window_to_world (canvas,
- event->crossing.x,
- event->crossing.y,
- &(event->crossing.x),
- &(event->crossing.y));
+ ev.crossing.x, ev.crossing.y,
+ &ev.crossing.x, &ev.crossing.y);
break;
case GDK_MOTION_NOTIFY:
@@ -223,10 +221,8 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
gnome_canvas_window_to_world (canvas,
- event->motion.x,
- event->motion.y,
- &(event->motion.x),
- &(event->motion.y));
+ ev.motion.x, ev.motion.y,
+ &ev.motion.x, &ev.motion.y);
break;
default:
@@ -252,7 +248,7 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
gtk_object_ref (GTK_OBJECT (item));
gtk_signal_emit_by_name (GTK_OBJECT (item), "event",
- event,
+ &ev,
&finished);
if (GTK_OBJECT_DESTROYED (item))
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index fb67bf0379..83f276e1f6 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -149,7 +149,7 @@ is_descendant (GnomeCanvasItem *item, GnomeCanvasItem *parent)
static int
emit_event (GnomeCanvas *canvas, GdkEvent *event)
{
- /*GdkEvent ev;*/
+ GdkEvent ev;
gint finished;
GnomeCanvasItem *item;
GnomeCanvasItem *parent;
@@ -205,16 +205,14 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
* offsets of the fields in the event structures.
*/
- /*ev = *event;*/
+ ev = *event;
- switch (event->type) {
+ switch (ev.type) {
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
gnome_canvas_window_to_world (canvas,
- event->crossing.x,
- event->crossing.y,
- &(event->crossing.x),
- &(event->crossing.y));
+ ev.crossing.x, ev.crossing.y,
+ &ev.crossing.x, &ev.crossing.y);
break;
case GDK_MOTION_NOTIFY:
@@ -223,10 +221,8 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
gnome_canvas_window_to_world (canvas,
- event->motion.x,
- event->motion.y,
- &(event->motion.x),
- &(event->motion.y));
+ ev.motion.x, ev.motion.y,
+ &ev.motion.x, &ev.motion.y);
break;
default:
@@ -252,7 +248,7 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
gtk_object_ref (GTK_OBJECT (item));
gtk_signal_emit_by_name (GTK_OBJECT (item), "event",
- event,
+ &ev,
&finished);
if (GTK_OBJECT_DESTROYED (item))