From 65ae146bc9ece3fb3c1fbafd1ea853ccef2e4ffa Mon Sep 17 00:00:00 2001 From: Andreas Butti Date: Sat, 29 Dec 2018 18:12:20 +0100 Subject: [PATCH] Probably fixed crash --- src/gui/inputdevices/touchdisable/TouchDisableX11.h | 3 +-- src/util/Path.cpp | 4 ++-- src/util/Path.h | 4 ++-- src/util/Util.cpp | 6 ++++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/gui/inputdevices/touchdisable/TouchDisableX11.h b/src/gui/inputdevices/touchdisable/TouchDisableX11.h index ec0548f2..eb449195 100644 --- a/src/gui/inputdevices/touchdisable/TouchDisableX11.h +++ b/src/gui/inputdevices/touchdisable/TouchDisableX11.h @@ -15,8 +15,7 @@ #include "TouchDisableInterface.h" -// Disabled at the moment, may cause issues -//#define X11_ENABLED +#define X11_ENABLED #ifdef WIN32 #undef X11_ENABLED diff --git a/src/util/Path.cpp b/src/util/Path.cpp index da97c260..2a74a56d 100644 --- a/src/util/Path.cpp +++ b/src/util/Path.cpp @@ -130,7 +130,7 @@ void Path::clearExtensions() /** * Return the Path as String */ -string Path::str() +const string Path::str() const { return path; } @@ -138,7 +138,7 @@ string Path::str() /** * Return the Path as String */ -const char* Path::c_str() +const char* Path::c_str() const { return path.c_str(); } diff --git a/src/util/Path.h b/src/util/Path.h index ef902b40..32118730 100644 --- a/src/util/Path.h +++ b/src/util/Path.h @@ -78,12 +78,12 @@ public: /** * Return the Path as String */ - string str(); + const string str() const; /** * Return the Path as String */ - const char* c_str(); + const char* c_str() const; /** * Get the parent path diff --git a/src/util/Util.cpp b/src/util/Util.cpp index 30065213..c5087b92 100644 --- a/src/util/Util.cpp +++ b/src/util/Util.cpp @@ -93,8 +93,10 @@ Path Util::getConfigSubfolder(Path subfolder) { if (g_mkdir_with_parents(p.c_str(), 0700)) { - string msg = FS(_F("Could not create folder: {1}") % p.str()); - XojMsgBox::showErrorToUser(NULL, msg); + Util::execInUiThread([=]() { + string msg = FS(_F("Could not create folder: {1}") % p.str()); + XojMsgBox::showErrorToUser(NULL, msg); + }); } }