File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -401,17 +401,20 @@ void I3Ipc::handleWorkspaceEvent(I3IpcEvent* event) {
401401 auto workspaceData = event->mData [" current" ];
402402
403403 auto * workspace = this ->findWorkspaceByID (workspaceData[" id" ].toInt (-1 ));
404+ auto existed = workspace != nullptr ;
404405
405- if (workspace == nullptr ) {
406+ if (!existed ) {
406407 workspace = new I3Workspace (this );
407408 }
408409
409410 if (workspaceData.isObject ()) {
410411 workspace->updateFromObject (workspaceData.toObject ().toVariantMap ());
411412 }
412413
413- this ->mWorkspaces .insertObject (workspace);
414- qCInfo (logI3Ipc) << " Added workspace" << workspace->name () << " to list" ;
414+ if (!existed) {
415+ this ->mWorkspaces .insertObject (workspace);
416+ qCInfo (logI3Ipc) << " Added workspace" << workspace->name () << " to list" ;
417+ }
415418 } else if (change == " focus" ) {
416419 auto oldData = event->mData [" old" ];
417420 auto newData = event->mData [" current" ];
You can’t perform that action at this time.
0 commit comments