diff options
author | Aaron Barany | 2018-12-08 00:08:10 -0800 |
---|---|---|
committer | Aaron Barany | 2018-12-08 00:08:10 -0800 |
commit | 1c1859b43f62d7411f85b2f4d83808f3eaf5b3ea (patch) | |
tree | d1831d0f477bb82d4a4c10e4e19a1054075c126a | |
parent | ecbce8687a0f0c9a41f109bad102e627bf1d0016 (diff) | |
download | aur-1c1859b43f62d7411f85b2f4d83808f3eaf5b3ea.tar.gz |
Added fix for exiting debugger on program exit.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rw-r--r-- | qtcreator-exit-debugger-fix.patch | 81 |
3 files changed, 89 insertions, 2 deletions
@@ -32,10 +32,12 @@ pkgbase = qtcreator-fixed-themes source = qtcreator-clang-plugins.patch source = qtcreator-dark-theme-fixes.patch source = qtcreator-dark-and-flat-selection-fixes.patch + source = qtcreator-exit-debugger-fix.patch sha256sums = aec7b4595e17f5536eb2eef4331057f2d0fa4ba0a46f4968cc06959a1d589b43 sha256sums = 6f19fc9d83964a5460d224b3d44ce580553847960181fe0364e2ce26e1efd2e6 sha256sums = a7b87219de0ee3e18754749a057535c04357acc2478dcb3fca6bc4b1ba8a8178 sha256sums = 514d9ff2989b0c865ead40b62df79f46871cbc1840ca552c64947b2e6c7d7d18 + sha256sums = f938a72cc79c9ed8de07da8af79b170f67448a74dbd3228dd3de7e4855ed633d pkgname = qtcreator-fixed-themes @@ -34,11 +34,13 @@ optdepends=('qt5-doc: integrated Qt documentation' source=("http://download.qt.io/official_releases/qtcreator/${pkgver%.*}/$pkgver/qt-creator-opensource-src-$pkgver.tar.xz" qtcreator-clang-plugins.patch qtcreator-dark-theme-fixes.patch - qtcreator-dark-and-flat-selection-fixes.patch) + qtcreator-dark-and-flat-selection-fixes.patch + qtcreator-exit-debugger-fix.patch) sha256sums=('aec7b4595e17f5536eb2eef4331057f2d0fa4ba0a46f4968cc06959a1d589b43' '6f19fc9d83964a5460d224b3d44ce580553847960181fe0364e2ce26e1efd2e6' 'a7b87219de0ee3e18754749a057535c04357acc2478dcb3fca6bc4b1ba8a8178' - '514d9ff2989b0c865ead40b62df79f46871cbc1840ca552c64947b2e6c7d7d18') + '514d9ff2989b0c865ead40b62df79f46871cbc1840ca552c64947b2e6c7d7d18' + 'f938a72cc79c9ed8de07da8af79b170f67448a74dbd3228dd3de7e4855ed633d') prepare() { mkdir -p build @@ -55,6 +57,8 @@ prepare() { # Theme fixes patch -p1 -i ../qtcreator-dark-theme-fixes.patch patch -p1 -i ../qtcreator-dark-and-flat-selection-fixes.patch + # Bonus patch! Fix exiting debugger on program exit. + patch -p1 -i ../qtcreator-exit-debugger-fix.patch } build() { diff --git a/qtcreator-exit-debugger-fix.patch b/qtcreator-exit-debugger-fix.patch new file mode 100644 index 000000000000..934752aeb308 --- /dev/null +++ b/qtcreator-exit-debugger-fix.patch @@ -0,0 +1,81 @@ +diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp +index d8975a82dd..a8ce2e2eee 100644 +--- a/src/plugins/debugger/debuggerengine.cpp ++++ b/src/plugins/debugger/debuggerengine.cpp +@@ -418,6 +418,8 @@ public: + m_watchHandler.cleanup(); + m_engine->showMessage(tr("Debugger finished."), StatusBar); + m_engine->setState(DebuggerFinished); // Also destroys views. ++ if (boolSetting(SwitchModeOnExit)) ++ EngineManager::deactivateDebugMode(); + } + + void scheduleResetLocation() +diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp +index a0602851ea..12371975f8 100644 +--- a/src/plugins/debugger/debuggermainwindow.cpp ++++ b/src/plugins/debugger/debuggermainwindow.cpp +@@ -26,6 +26,7 @@ + #include "debuggermainwindow.h" + #include "debuggerconstants.h" + #include "debuggerinternalconstants.h" ++#include "enginemanager.h" + + #include <coreplugin/actionmanager/actioncontainer.h> + #include <coreplugin/actionmanager/actionmanager.h> +@@ -696,7 +697,7 @@ void Perspective::addWindow(QWidget *widget, + + void Perspective::select() + { +- ModeManager::activateMode(Debugger::Constants::MODE_DEBUG); ++ Debugger::Internal::EngineManager::activateDebugMode(); + if (Perspective::currentPerspective() == this) + return; + theMainWindow->d->selectPerspective(this); +diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp +index 4c7fb7a84c..c79cecab50 100644 +--- a/src/plugins/debugger/debuggerplugin.cpp ++++ b/src/plugins/debugger/debuggerplugin.cpp +@@ -706,7 +706,6 @@ public: + void runScheduled(); + void attachCore(); + +- void runControlFinished(DebuggerRunTool *runTool); + void remoteCommand(const QStringList &options); + + void dumpLog(); +diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp +index a3c503672a..883668e498 100644 +--- a/src/plugins/debugger/enginemanager.cpp ++++ b/src/plugins/debugger/enginemanager.cpp +@@ -422,6 +422,18 @@ void EngineManager::activateDebugMode() + } + } + ++void EngineManager::deactivateDebugMode() ++{ ++ if (ModeManager::currentModeId() == Constants::MODE_DEBUG && d->m_previousMode.isValid()) { ++ // If stopping the application also makes Qt Creator active (as the ++ // "previously active application"), doing the switch synchronously ++ // leads to funny effects with floating dock widgets ++ const Core::Id mode = d->m_previousMode; ++ QTimer::singleShot(0, d, [mode]() { ModeManager::activateMode(mode); }); ++ d->m_previousMode = Id(); ++ } ++} ++ + bool EngineManager::isLastOf(const QString &type) + { + int count = 0; +diff --git a/src/plugins/debugger/enginemanager.h b/src/plugins/debugger/enginemanager.h +index a41f13183a..a1ee76c60b 100644 +--- a/src/plugins/debugger/enginemanager.h ++++ b/src/plugins/debugger/enginemanager.h +@@ -49,6 +49,7 @@ public: + static void unregisterEngine(DebuggerEngine *engine); + static void activateEngine(DebuggerEngine *engine); + static void activateDebugMode(); ++ static void deactivateDebugMode(); + static bool isLastOf(const QString &type); + + static QList<QPointer<DebuggerEngine> > engines(); |