summaryrefslogtreecommitdiffstats
path: root/src/display/sp-canvas.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2014-02-28 03:13:51 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2014-02-28 03:13:51 +0000
commitf776b7244d69143db71077456836d8745d6f30ed (patch)
tree65ba85b1019ace6b047f36d158245e56d6949623 /src/display/sp-canvas.cpp
parentWork around a crash in the Undo History dialog caused by incorrect (diff)
downloadinkscape-f776b7244d69143db71077456836d8745d6f30ed.tar.gz
inkscape-f776b7244d69143db71077456836d8745d6f30ed.zip
Copy event with gdk_event_copy instead of assigning to structure by value.
Fixes problems on GTK+/Quartz 2.24.19. For more information, see LP #1198597 and https://bugzilla.gnome.org/show_bug.cgi?id=694273#c33 Fixed bugs: - https://launchpad.net/bugs/1198597 (bzr r13072)
Diffstat (limited to 'src/display/sp-canvas.cpp')
-rw-r--r--src/display/sp-canvas.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 543962376..c502daf64 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1529,23 +1529,22 @@ int SPCanvasImpl::emitEvent(SPCanvas *canvas, GdkEvent *event)
// Convert to world coordinates -- we have two cases because of different
// offsets of the fields in the event structures.
- //
- GdkEvent ev = *event;
+ GdkEvent *ev = gdk_event_copy(event);
- switch (ev.type) {
+ switch (ev->type) {
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
- ev.crossing.x += canvas->x0;
- ev.crossing.y += canvas->y0;
+ ev->crossing.x += canvas->x0;
+ ev->crossing.y += canvas->y0;
break;
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
- ev.motion.x += canvas->x0;
- ev.motion.y += canvas->y0;
+ ev->motion.x += canvas->x0;
+ ev->motion.y += canvas->y0;
break;
default:
break;
@@ -1598,12 +1597,14 @@ int SPCanvasImpl::emitEvent(SPCanvas *canvas, GdkEvent *event)
while (item && !finished) {
g_object_ref (item);
- g_signal_emit (G_OBJECT (item), item_signals[ITEM_EVENT], 0, &ev, &finished);
+ g_signal_emit (G_OBJECT (item), item_signals[ITEM_EVENT], 0, ev, &finished);
SPCanvasItem *parent = item->parent;
g_object_unref (item);
item = parent;
}
+ gdk_event_free(ev);
+
return finished;
}