@@ -88,11 +88,6 @@ auto Workspaces::parseConfig(const Json::Value &config) -> void {
88
88
m_moveToMonitor = configMoveToMonitor.asBool ();
89
89
}
90
90
91
- auto configActivePerMonitor = config_[" active-per-monitor" ];
92
- if (configActivePerMonitor.isBool ()) {
93
- m_activePerMonitor = configActivePerMonitor.asBool ();
94
- }
95
-
96
91
auto configSortBy = config_[" sort-by" ];
97
92
if (configSortBy.isString ()) {
98
93
auto sortByStr = configSortBy.asString ();
@@ -331,14 +326,7 @@ void Workspaces::onEvent(const std::string &ev) {
331
326
}
332
327
333
328
void Workspaces::onWorkspaceActivated (std::string const &payload) {
334
- if (!m_activePerMonitor) {
335
- m_activeWorkspaceName = payload;
336
- return ;
337
- }
338
- auto activeWorkspace = gIPC ->getSocket1JsonReply (" activeworkspace" );
339
- if (m_bar.output ->name == activeWorkspace[" monitor" ].asString ()) {
340
- m_activeWorkspaceName = payload;
341
- }
329
+ m_activeWorkspaceName = payload;
342
330
}
343
331
344
332
void Workspaces::onSpecialWorkspaceActivated (std::string const &payload) {
@@ -391,16 +379,6 @@ void Workspaces::onWorkspaceMoved(std::string const &payload) {
391
379
if (m_bar.output ->name == monitorName) {
392
380
Json::Value clientsData = gIPC ->getSocket1JsonReply (" clients" );
393
381
onWorkspaceCreated (workspaceName, clientsData);
394
- if (m_activePerMonitor) {
395
- for (Json::Value &monitor : gIPC ->getSocket1JsonReply (" monitors" )) {
396
- if (m_bar.output ->name == monitor[" name" ].asString ()) {
397
- auto ws = monitor[" activeWorkspace" ];
398
- if (ws.isObject () && (ws[" name" ].isString ())) {
399
- m_activeWorkspaceName = ws[" name" ].asString ();
400
- }
401
- }
402
- }
403
- }
404
382
} else {
405
383
spdlog::debug (" Removing workspace because it was moved to another monitor: {}" );
406
384
onWorkspaceDestroyed (workspaceName);
@@ -426,13 +404,10 @@ void Workspaces::onWorkspaceRenamed(std::string const &payload) {
426
404
427
405
void Workspaces::onMonitorFocused (std::string const &payload) {
428
406
spdlog::trace (" Monitor focused: {}" , payload);
429
- auto monitorName = payload.substr (0 , payload.find (' ,' ));
430
- if (!m_activePerMonitor || m_bar.output ->name == monitorName) {
431
- m_activeWorkspaceName = payload.substr (payload.find (' ,' ) + 1 );
432
- }
407
+ m_activeWorkspaceName = payload.substr (payload.find (' ,' ) + 1 );
433
408
434
409
for (Json::Value &monitor : gIPC ->getSocket1JsonReply (" monitors" )) {
435
- if (monitor[" name" ].asString () == monitorName ) {
410
+ if (monitor[" name" ].asString () == payload. substr ( 0 , payload. find ( ' , ' )) ) {
436
411
auto name = monitor[" specialWorkspace" ][" name" ].asString ();
437
412
m_activeSpecialWorkspaceName = !name.starts_with (" special:" ) ? name : name.substr (8 );
438
413
}
@@ -834,18 +809,7 @@ void Workspaces::extendOrphans(int workspaceId, Json::Value const &clientsJson)
834
809
}
835
810
836
811
void Workspaces::init () {
837
- if (!m_activePerMonitor) {
838
- m_activeWorkspaceName = (gIPC ->getSocket1JsonReply (" activeworkspace" ))[" name" ].asString ();
839
- } else {
840
- for (Json::Value &monitor : gIPC ->getSocket1JsonReply (" monitors" )) {
841
- if (m_bar.output ->name == monitor[" name" ].asString ()) {
842
- auto ws = monitor[" activeWorkspace" ];
843
- if (ws.isObject () && (ws[" name" ].isString ())) {
844
- m_activeWorkspaceName = ws[" name" ].asString ();
845
- }
846
- }
847
- }
848
- }
812
+ m_activeWorkspaceName = (gIPC ->getSocket1JsonReply (" activeworkspace" ))[" name" ].asString ();
849
813
850
814
initializeWorkspaces ();
851
815
updateWindowCount ();
0 commit comments