summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/dropper-tool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/tools/dropper-tool.cpp')
-rw-r--r--src/ui/tools/dropper-tool.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp
index 9c47b50e9..99d42a211 100644
--- a/src/ui/tools/dropper-tool.cpp
+++ b/src/ui/tools/dropper-tool.cpp
@@ -72,21 +72,17 @@ const std::string& DropperTool::getPrefsPath() {
const std::string DropperTool::prefsPath = "/tools/dropper";
-DropperTool::DropperTool() : ToolBase() {
- this->R = 0;
- this->G = 0;
- this->B = 0;
- this->alpha = 0;
- this->dragging = false;
-
- this->grabbed = 0;
- this->area = 0;
- this->centre = Geom::Point(0, 0);
-
- this->cursor_shape = cursor_dropper_f_xpm;
- this->hot_x = 7;
- this->hot_y = 7;
-
+DropperTool::DropperTool()
+ : ToolBase(cursor_dropper_f_xpm, 7, 7)
+ , R(0)
+ , G(0)
+ , B(0)
+ , alpha(0)
+ , dragging(false)
+ , grabbed(NULL)
+ , area(NULL)
+ , centre(0, 0)
+{
cursor_dropper_fill = sp_cursor_new_from_xpm(cursor_dropper_f_xpm , 7, 7);
cursor_dropper_stroke = sp_cursor_new_from_xpm(cursor_dropper_s_xpm , 7, 7);
}
@@ -152,6 +148,8 @@ void DropperTool::finish() {
#endif
cursor_dropper_fill = NULL;
}
+
+ ToolBase::finish();
}
/**
@@ -338,6 +336,10 @@ bool DropperTool::root_handler(GdkEvent* event) {
if (prefs->getBool("/tools/dropper/onetimepick", false)) {
prefs->setBool("/tools/dropper/onetimepick", false);
sp_toggle_dropper(desktop);
+
+ // sp_toggle_dropper will delete ourselves.
+ // Thus, make sure we return immediately.
+ return true;
}
ret = TRUE;