workspace: fix missing name via focusworkspaceoncurrentmonitor (#8484)

This commit is contained in:
sslater11 2024-11-16 16:39:58 +00:00 committed by GitHub
parent 7affc34ab4
commit 83be2480c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1887,7 +1887,7 @@ SDispatchResult CKeybindManager::moveWorkspaceToMonitor(std::string args) {
} }
SDispatchResult CKeybindManager::focusWorkspaceOnCurrentMonitor(std::string args) { SDispatchResult CKeybindManager::focusWorkspaceOnCurrentMonitor(std::string args) {
auto workspaceID = getWorkspaceIDNameFromString(args).id; auto [workspaceID, workspaceName] = getWorkspaceIDNameFromString(args);
if (workspaceID == WORKSPACE_INVALID) { if (workspaceID == WORKSPACE_INVALID) {
Debug::log(ERR, "focusWorkspaceOnCurrentMonitor invalid workspace!"); Debug::log(ERR, "focusWorkspaceOnCurrentMonitor invalid workspace!");
return {.success = false, .error = "focusWorkspaceOnCurrentMonitor invalid workspace!"}; return {.success = false, .error = "focusWorkspaceOnCurrentMonitor invalid workspace!"};
@ -1903,7 +1903,7 @@ SDispatchResult CKeybindManager::focusWorkspaceOnCurrentMonitor(std::string args
auto pWorkspace = g_pCompositor->getWorkspaceByID(workspaceID); auto pWorkspace = g_pCompositor->getWorkspaceByID(workspaceID);
if (!pWorkspace) { if (!pWorkspace) {
pWorkspace = g_pCompositor->createNewWorkspace(workspaceID, PCURRMONITOR->ID); pWorkspace = g_pCompositor->createNewWorkspace(workspaceID, PCURRMONITOR->ID, workspaceName);
// we can skip the moving, since it's already on the current monitor // we can skip the moving, since it's already on the current monitor
changeworkspace(pWorkspace->getConfigName()); changeworkspace(pWorkspace->getConfigName());
return {}; return {};