@@ -208,6 +208,7 @@ void Workspaces::doUpdate() {
208
208
}
209
209
210
210
spdlog::trace (" Updating workspace states" );
211
+ auto updated_workspaces = gIPC ->getSocket1JsonReply (" workspaces" );
211
212
for (auto &workspace : m_workspaces) {
212
213
// active
213
214
workspace->setActive (workspace->name () == m_activeWorkspaceName ||
@@ -226,6 +227,16 @@ void Workspaces::doUpdate() {
226
227
if (m_withIcon) {
227
228
workspaceIcon = workspace->selectIcon (m_iconsMap);
228
229
}
230
+
231
+ // update m_output
232
+ auto updated_workspace =
233
+ std::find_if (updated_workspaces.begin (), updated_workspaces.end (), [&workspace](auto &w) {
234
+ auto wNameRaw = w[" name" ].asString ();
235
+ auto wName = wNameRaw.starts_with (" special:" ) ? wNameRaw.substr (8 ) : wNameRaw;
236
+ return wName == workspace->name ();
237
+ });
238
+ workspace->setOutput ((*updated_workspace)[" monitor" ].asString ());
239
+
229
240
workspace->update (m_format, workspaceIcon);
230
241
}
231
242
@@ -876,6 +887,7 @@ void Workspace::update(const std::string &format, const std::string &icon) {
876
887
addOrRemoveClass (styleContext, isPersistent (), " persistent" );
877
888
addOrRemoveClass (styleContext, isUrgent (), " urgent" );
878
889
addOrRemoveClass (styleContext, isVisible (), " visible" );
890
+ addOrRemoveClass (styleContext, m_workspaceManager.getBarOutput () == output (), " hosting-monitor" );
879
891
880
892
std::string windows;
881
893
auto windowSeparator = m_workspaceManager.getWindowSeparator ();
0 commit comments