forked from quickshell/quickshell
core/reloader: fix Quickshell.reload not working
Has been broken since engine generations were introduced.
This commit is contained in:
parent
4eb5dc5593
commit
c6bf826031
3 changed files with 7 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <qvariant.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "generation.hpp"
|
||||
#include "qmlscreen.hpp"
|
||||
#include "rootwrapper.hpp"
|
||||
|
||||
|
@ -144,8 +145,8 @@ QQmlListProperty<QuickshellScreenInfo> QuickshellGlobal::screens() {
|
|||
}
|
||||
|
||||
void QuickshellGlobal::reload(bool hard) {
|
||||
auto* rootobj = QQmlEngine::contextForObject(this)->engine()->parent();
|
||||
auto* root = qobject_cast<RootWrapper*>(rootobj);
|
||||
auto* generation = EngineGeneration::findObjectGeneration(this);
|
||||
auto* root = generation == nullptr ? nullptr : generation->wrapper;
|
||||
|
||||
if (root == nullptr) {
|
||||
qWarning() << "cannot find RootWrapper for reload, ignoring request";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue