diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-01-19 05:38:09 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-01-19 05:38:09 +0000 |
| commit | eac3c11251e65774a2f4f610f2799592978487d8 (patch) | |
| tree | 11c68dad7013c79a38872f16d221d0c653dc2ffb /src/ui/tools/tool-base.cpp | |
| parent | Fix missing embeded image condition, kindly caught by suv in bug #1270334 (diff) | |
| download | inkscape-eac3c11251e65774a2f4f610f2799592978487d8.tar.gz inkscape-eac3c11251e65774a2f4f610f2799592978487d8.zip | |
Try another fix for the undo when dragging bug #168695
Fixed bugs:
- https://launchpad.net/bugs/168695
(bzr r12955)
Diffstat (limited to 'src/ui/tools/tool-base.cpp')
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 6c7867633..f8868ec0e 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -57,6 +57,7 @@ #include "shape-editor.h" #include "sp-guide.h" #include "color.h" +#include "document-undo.h" // globals for temporary switching to selector by space static bool selector_toggled = FALSE; @@ -977,9 +978,16 @@ gint sp_event_context_root_handler(ToolBase * event_context, gint sp_event_context_virtual_root_handler(ToolBase * event_context, GdkEvent * 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 = (SP_EVENT_CONTEXT_CLASS(G_OBJECT_GET_CLASS(event_context)))->root_handler(event_context, event); + if (event_context) { + // We want to disable undo while we drag anything + SPDocument *document = sp_desktop_document(event_context->desktop); + if (event->type == GDK_BUTTON_PRESS) { + event_context->undo_sensitive = DocumentUndo::getUndoSensitive(document); + DocumentUndo::setUndoSensitive(document, false); + } else if (event->type == GDK_BUTTON_RELEASE) { + DocumentUndo::setUndoSensitive(document, event_context->undo_sensitive); + } + ret = event_context->root_handler(event); set_event_location(event_context->desktop, event); |
