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
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 26 additions and 12 deletions

View file

@ -81,7 +81,7 @@ public:
[[nodiscard]] ObjectModel<HyprlandWorkspace>* workspaces();
// No byId because these preemptively create objects. The given id is set if created.
HyprlandWorkspace* findWorkspaceByName(const QString& name, bool createIfMissing, qint32 id = 0);
HyprlandWorkspace* findWorkspaceByName(const QString& name, bool createIfMissing, qint32 id = -1);
HyprlandMonitor* findMonitorByName(const QString& name, bool createIfMissing, qint32 id = -1);
// canCreate avoids making ghost workspaces when the connection races