diff --git a/src/gui/dialog/SettingsDialog.cpp b/src/gui/dialog/SettingsDialog.cpp index cf6cd756..f730c350 100644 --- a/src/gui/dialog/SettingsDialog.cpp +++ b/src/gui/dialog/SettingsDialog.cpp @@ -136,6 +136,12 @@ SettingsDialog::~SettingsDialog() } this->buttonConfigs.clear(); + for (DeviceClassConfigGui* dev : this->deviceClassConfigs) + { + delete dev; + } + this->deviceClassConfigs.clear(); + // DO NOT delete settings! this->settings = NULL; diff --git a/src/gui/inputdevices/PenInputHandler.cpp b/src/gui/inputdevices/PenInputHandler.cpp index 1b3d97a3..d07106b7 100644 --- a/src/gui/inputdevices/PenInputHandler.cpp +++ b/src/gui/inputdevices/PenInputHandler.cpp @@ -105,21 +105,29 @@ bool PenInputHandler::actionStart(InputEvent* event) // set reference data for handling of entering/leaving page this->updateLastEvent(event); - // Flag running input - this->inputRunning = true; - this->penInWidget = true; - // Change the tool depending on the key changeTool(event); + // Flag running input + ToolHandler* toolHandler = this->inputContext->getToolHandler(); + ToolType toolType = toolHandler->getToolType(); + + // + if (toolType != TOOL_IMAGE) + { + this->inputRunning = true; + } else { + this->deviceClassPressed = false; + } + + this->penInWidget = true; + GtkXournal* xournal = this->inputContext->getXournal(); XournalppCursor* cursor = xournal->view->getCursor(); cursor->setMouseDown(true); - ToolHandler* toolHandler = this->inputContext->getToolHandler(); - ToolType toolType = toolHandler->getToolType(); // Save the starting offset when hand-tool is selected to get a reference for the scroll-offset if (toolType == TOOL_HAND) @@ -371,6 +379,7 @@ bool PenInputHandler::actionEnd(InputEvent* event) } this->inputRunning = false; + delete this->lastHitEvent; this->lastHitEvent = nullptr; return false;