hyprland/ipc: add null checks and ws preinit to toplevel object init

Previously HyprlandToplevel::updateFromObject did not call
findWorkspaceByName with createIfMissing=true, leaving bWorkspace null
for a later insertToplevel call from HyprlandIpc::refreshToplevels.
This commit is contained in:
outfoxxed 2026-03-16 22:38:32 -07:00
parent 365bf16b1e
commit 1bd5b083cb
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
3 changed files with 5 additions and 8 deletions

View file

@ -48,6 +48,7 @@ set shell id.
- Fixed volumes not initializing if a pipewire device was already loaded before its node. - Fixed volumes not initializing if a pipewire device was already loaded before its node.
- Fixed hyprland active toplevel not resetting after window closes. - Fixed hyprland active toplevel not resetting after window closes.
- Fixed hyprland ipc window names and titles being reversed. - Fixed hyprland ipc window names and titles being reversed.
- Fixed a hyprland ipc crash when refreshing toplevels before workspaces.
- Fixed missing signals for system tray item title and description updates. - Fixed missing signals for system tray item title and description updates.
- Fixed asynchronous loaders not working after reload. - Fixed asynchronous loaders not working after reload.
- Fixed asynchronous loaders not working before window creation. - Fixed asynchronous loaders not working before window creation.

View file

@ -729,7 +729,7 @@ void HyprlandIpc::refreshToplevels() {
} }
auto* workspace = toplevel->bindableWorkspace().value(); auto* workspace = toplevel->bindableWorkspace().value();
workspace->insertToplevel(toplevel); if (workspace) workspace->insertToplevel(toplevel);
} }
}); });
} }

View file

@ -72,20 +72,16 @@ void HyprlandToplevel::updateFromObject(const QVariantMap& object) {
Qt::beginPropertyUpdateGroup(); Qt::beginPropertyUpdateGroup();
bool ok = false; bool ok = false;
auto address = addressStr.toULongLong(&ok, 16); auto address = addressStr.toULongLong(&ok, 16);
if (!ok || !address) { if (ok && address) this->setAddress(address);
return;
}
this->setAddress(address);
this->bTitle = title; this->bTitle = title;
auto workspaceMap = object.value("workspace").toMap(); auto workspaceMap = object.value("workspace").toMap();
auto workspaceName = workspaceMap.value("name").toString(); auto workspaceName = workspaceMap.value("name").toString();
auto* workspace = this->ipc->findWorkspaceByName(workspaceName, false); auto* workspace = this->ipc->findWorkspaceByName(workspaceName, true);
if (!workspace) return; if (workspace) this->setWorkspace(workspace);
this->setWorkspace(workspace);
this->bLastIpcObject = object; this->bLastIpcObject = object;
Qt::endPropertyUpdateGroup(); Qt::endPropertyUpdateGroup();
} }