forked from quickshell/quickshell
root: recreate the qml engine on reload instead of clearing it
This causes singletons to be recreated instead of kept alive.
This commit is contained in:
parent
9f6ef37f61
commit
463f9a297f
9 changed files with 109 additions and 78 deletions
|
@ -53,6 +53,23 @@ private:
|
|||
bool mWatchFiles = true;
|
||||
};
|
||||
|
||||
class QuickshellTracked: public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
QuickshellTracked();
|
||||
|
||||
QVector<QuickshellScreenInfo*> screens;
|
||||
|
||||
static QuickshellTracked* instance();
|
||||
|
||||
private slots:
|
||||
void updateScreens();
|
||||
|
||||
signals:
|
||||
void screensChanged();
|
||||
};
|
||||
|
||||
class QuickshellGlobal: public QObject {
|
||||
Q_OBJECT;
|
||||
// clang-format off
|
||||
|
@ -124,12 +141,7 @@ signals:
|
|||
void workingDirectoryChanged();
|
||||
void watchFilesChanged();
|
||||
|
||||
public slots:
|
||||
void updateScreens();
|
||||
|
||||
private:
|
||||
static qsizetype screensCount(QQmlListProperty<QuickshellScreenInfo>* prop);
|
||||
static QuickshellScreenInfo* screenAt(QQmlListProperty<QuickshellScreenInfo>* prop, qsizetype i);
|
||||
|
||||
QVector<QuickshellScreenInfo*> mScreens;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue