i3/ipc: fix workspace and monitor focus being unset on launch

This commit is contained in:
outfoxxed 2025-03-27 15:56:53 -07:00
parent 2028766e61
commit 14aa1793df
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
5 changed files with 26 additions and 9 deletions

View file

@ -43,17 +43,18 @@ void I3Monitor::updateFromObject(const QVariantMap& obj) {
if (!this->bActiveWorkspace
|| activeWorkspaceName != this->bActiveWorkspace->bindableName().value())
{
auto* workspace = this->ipc->findWorkspaceByName(activeWorkspaceName);
if (activeWorkspaceName.isEmpty() || workspace == nullptr) { // is null when output is disabled
if (activeWorkspaceName.isEmpty()) {
this->bActiveWorkspace = nullptr;
} else {
this->bActiveWorkspace = workspace;
this->bActiveWorkspace = this->ipc->findWorkspaceByName(activeWorkspaceName);
}
};
Qt::endPropertyUpdateGroup();
}
void I3Monitor::updateInitial(const QString& name) { this->bName = name; }
void I3Monitor::setFocusedWorkspace(I3Workspace* workspace) { this->bActiveWorkspace = workspace; };
} // namespace qs::i3::ipc