mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-02-23 03:33:57 +11:00
core/reloader: trigger onPostReload if launched post-reload
This is similar to the check in Reloadable, and fixes a number of hard to debug issues with Process, IpcHandler, NotificationServer, and GlobalShortcut not working depending on where you put them in a QML file.
This commit is contained in:
parent
0e6518a706
commit
9708d8212a
8 changed files with 36 additions and 38 deletions
|
|
@ -15,10 +15,11 @@
|
|||
|
||||
#include "../core/generation.hpp"
|
||||
#include "../core/qmlglobal.hpp"
|
||||
#include "../core/reload.hpp"
|
||||
#include "datastream.hpp"
|
||||
#include "processcore.hpp"
|
||||
|
||||
Process::Process(QObject* parent): QObject(parent) {
|
||||
Process::Process(QObject* parent): PostReloadHook(parent) {
|
||||
QObject::connect(
|
||||
QuickshellSettings::instance(),
|
||||
&QuickshellSettings::workingDirectoryChanged,
|
||||
|
|
@ -37,10 +38,7 @@ Process::~Process() {
|
|||
}
|
||||
}
|
||||
|
||||
void Process::onPostReload() {
|
||||
this->postReload = true;
|
||||
this->startProcessIfReady();
|
||||
}
|
||||
void Process::onPostReload() { this->startProcessIfReady(); }
|
||||
|
||||
bool Process::isRunning() const { return this->process != nullptr; }
|
||||
|
||||
|
|
@ -180,9 +178,10 @@ void Process::setStdinEnabled(bool enabled) {
|
|||
}
|
||||
|
||||
void Process::startProcessIfReady() {
|
||||
if (this->process != nullptr || !this->postReload || !this->targetRunning
|
||||
if (this->process != nullptr || !this->isPostReload || !this->targetRunning
|
||||
|| this->mCommand.isEmpty())
|
||||
return;
|
||||
|
||||
this->targetRunning = false;
|
||||
|
||||
auto& cmd = this->mCommand.first();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue