summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c72ad7b)
raw | patch | inline | side by side (parent: c72ad7b)
author | Diederik van Lierop <mailat-signdiedenrezidotnl> | |
Sat, 28 Aug 2010 08:09:45 +0000 (10:09 +0200) | ||
committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | |
Sat, 28 Aug 2010 08:09:45 +0000 (10:09 +0200) |
src/desktop.cpp | patch | blob | history | |
src/event-context.cpp | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index a93fb6a4a59aff704a52ac4748930411248f358b..1fdad010fb331493e16c679f42ac5c7affae8de7 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
event_context = next;
}
+ // The event_context will be null. This means that it will be impossible
+ // to process any event invoked by the lines below. See for example bug
+ // LP #622350. Cutting and undoing again in the node tool resets the event
+ // context to the node tool. In this bug the line bellow invokes GDK_LEAVE_NOTIFY
+ // events which cannot be handled and must be discarded.
ec = sp_event_context_new (type, this, config, SP_EVENT_CONTEXT_STATIC);
ec->next = event_context;
event_context = ec;
+ // Now the event_context has been set again and we can process all events again
sp_event_context_activate (ec);
_event_context_changed_signal.emit (this, ec);
}
void
SPDesktop::updateNow()
{
- sp_canvas_update_now(canvas);
+ sp_canvas_update_now(canvas);
}
void
diff --git a/src/event-context.cpp b/src/event-context.cpp
index 6184fb4c7352f3a27c20d12b51283c33337a6187..5d60379c84b43a625c5ab583cd29ca7483e4558c 100644 (file)
--- a/src/event-context.cpp
+++ b/src/event-context.cpp
}
gint sp_event_context_virtual_root_handler(SPEventContext * event_context, GdkEvent * event) {
- gint ret = ((SPEventContextClass *) G_OBJECT_GET_CLASS(event_context))->root_handler(event_context, event);
- set_event_location(event_context->desktop, event);
+ gint ret = false;
+ if (event_context) { // If no event-context is available then do nothing, otherwise Inkscape would crash
+ // (see the comment in SPDesktop::set_event_context, and bug LP #622350)
+ ret = ((SPEventContextClass *) G_OBJECT_GET_CLASS(event_context))->root_handler(event_context, event);
+ set_event_location(event_context->desktop, event);
+ }
return ret;
}
}
gint sp_event_context_virtual_item_handler(SPEventContext * event_context, SPItem * item, GdkEvent * event) {
- gint ret = ((SPEventContextClass *) G_OBJECT_GET_CLASS(event_context))->item_handler(event_context, item, event);
-
- if (!ret) {
- ret = sp_event_context_virtual_root_handler(event_context, event);
- } else {
- set_event_location(event_context->desktop, event);
+ gint ret = false;
+ if (event_context) { // If no event-context is available then do nothing, otherwise Inkscape would crash
+ // (see the comment in SPDesktop::set_event_context, and bug LP #622350)
+ ret = ((SPEventContextClass *) G_OBJECT_GET_CLASS(event_context))->item_handler(event_context, item, event);
+ if (!ret) {
+ ret = sp_event_context_virtual_root_handler(event_context, event);
+ } else {
+ set_event_location(event_context->desktop, event);
+ }
}
return ret;