summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-01-20 01:30:15 +0000
committerMartin Owens <doctormo@gmail.com>2014-01-20 01:30:15 +0000
commitcca2c219973a60fb6535836559aa42ec2b9cb630 (patch)
tree0499397b36d3892b8b5bb98c483a782e1ed5fdc8 /src/ui
parentAllow undo methods to survive a non-sensitive call. (diff)
downloadinkscape-cca2c219973a60fb6535836559aa42ec2b9cb630.tar.gz
inkscape-cca2c219973a60fb6535836559aa42ec2b9cb630.zip
Revert changes from r12959 and r12955, impliment new stratedgy to fix bug #168695
Fixed bugs: - https://launchpad.net/bugs/168695 (bzr r12960)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tools/tool-base.cpp16
-rw-r--r--src/ui/tools/tool-base.h3
2 files changed, 8 insertions, 11 deletions
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index f8868ec0e..3b51147e0 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -57,7 +57,6 @@
#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;
@@ -99,6 +98,7 @@ ToolBase::ToolBase() {
this->hot_x = 0;
this->yp = 0;
this->within_tolerance = false;
+ this->is_dragging = false;
this->tolerance = 0;
//this->key = 0;
this->item_to_select = 0;
@@ -979,18 +979,14 @@ 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) {
- // 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);
- }
+ if(event->type == GDK_BUTTON_PRESS)
+ event_context->is_dragging = true;
ret = event_context->root_handler(event);
-
set_event_location(event_context->desktop, event);
+
+ if(event->type == GDK_BUTTON_RELEASE)
+ event_context->is_dragging = false;
}
return ret;
}
diff --git a/src/ui/tools/tool-base.h b/src/ui/tools/tool-base.h
index 068bc6402..ab8bd8caa 100644
--- a/src/ui/tools/tool-base.h
+++ b/src/ui/tools/tool-base.h
@@ -118,8 +118,9 @@ public:
gint xp, yp; ///< where drag started
gint tolerance;
+ bool is_dragging; // Is a tool currently dragging something
+
bool within_tolerance; ///< are we still within tolerance of origin
- bool undo_sensitive; /// Was undo previously sensitive before drag
SPItem *item_to_select; ///< the item where mouse_press occurred, to
///< be selected if this is a click not drag