diff options
author | JP Rosevear <jpr@ximian.com> | 2001-02-10 06:27:37 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-02-10 06:27:37 +0800 |
commit | 414408be596cdff396e6295d8a9d82ecb6d40e6a (patch) | |
tree | 6b6e1efa17ca378ce658c8c4c48aa6356626cb54 /widgets/misc | |
parent | 919644966e206434e2bd176ee12f684c2aba22f2 (diff) | |
download | gsoc2013-evolution-414408be596cdff396e6295d8a9d82ecb6d40e6a.tar.gz gsoc2013-evolution-414408be596cdff396e6295d8a9d82ecb6d40e6a.tar.zst gsoc2013-evolution-414408be596cdff396e6295d8a9d82ecb6d40e6a.zip |
Since gdkevent is a union, casting a smaller struct to a gdkevent caused
2001-02-09 JP Rosevear <jpr@ximian.com>
* gal/widgets/e-canvas.c (e_canvas_key): Since gdkevent is a
union, casting a smaller struct to a gdkevent caused unknown
memory to be copied around. fix by copying to a full gdkevent
structure before calling gdkevent.
(e_canvas_focus_in): ditto
(e_canvas_focus_out): ditto
svn path=/trunk/; revision=8153
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-canvas.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index e772cd686f..ffc3a333f8 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -271,14 +271,17 @@ static gint e_canvas_key (GtkWidget *widget, GdkEventKey *event) { GnomeCanvas *canvas; + GdkEvent full_event; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CANVAS (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); canvas = GNOME_CANVAS (widget); + + full_event.key = *event; - return emit_event (canvas, (GdkEvent *) event); + return emit_event (canvas, &full_event); } @@ -333,6 +336,7 @@ e_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event) { GnomeCanvas *canvas; ECanvas *ecanvas; + GdkEvent full_event; canvas = GNOME_CANVAS (widget); ecanvas = E_CANVAS (widget); @@ -342,10 +346,12 @@ e_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event) if (ecanvas->ic) gdk_im_begin (ecanvas->ic, canvas->layout.bin_window); - if (canvas->focused_item) - return emit_event (canvas, (GdkEvent *) event); - else + if (canvas->focused_item) { + full_event.focus_change = *event; + return emit_event (canvas, &full_event); + } else { return FALSE; + } } /* Focus out handler for the canvas */ @@ -354,6 +360,7 @@ e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event) { GnomeCanvas *canvas; ECanvas *ecanvas; + GdkEvent full_event; canvas = GNOME_CANVAS (widget); ecanvas = E_CANVAS (widget); @@ -363,10 +370,12 @@ e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event) if (ecanvas->ic) gdk_im_end (); - if (canvas->focused_item) - return emit_event (canvas, (GdkEvent *) event); - else + if (canvas->focused_item) { + full_event.focus_change = *event; + return emit_event (canvas, &full_event); + } else { return FALSE; + } } static void |