hyprland/ipc: prefer ID based workspace lookups to name based ones

Should (hopefully) reduce race condition issues.
This commit is contained in:
outfoxxed 2025-01-27 22:19:28 -08:00
parent d3b1a65911
commit fb343ab639
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
3 changed files with 26 additions and 12 deletions

View file

@ -35,6 +35,7 @@ void HyprlandWorkspace::updateInitial(qint32 id, QString name) {
}
void HyprlandWorkspace::updateFromObject(QVariantMap object) {
auto name = object.value("name").value<QString>();
auto monitorId = object.value("monitorID").value<qint32>();
auto monitorName = object.value("monitor").value<QString>();
@ -48,8 +49,8 @@ void HyprlandWorkspace::updateFromObject(QVariantMap object) {
// No events we currently handle give a workspace id but not a name,
// so we shouldn't set this if it isn't an initial query
if (initial) {
this->mName = object.value("name").value<QString>();
if (initial && name != this->mName) {
this->mName = name;
emit this->nameChanged();
}