mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-29 18:25:59 +01:00
set workspace name in previous
This commit is contained in:
parent
170def35d7
commit
eb3c132fc5
1 changed files with 8 additions and 4 deletions
|
@ -610,16 +610,20 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
|
|
||||||
internal = true;
|
internal = true;
|
||||||
} else if (args.find("previous") == 0) {
|
} else if (args.find("previous") == 0) {
|
||||||
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(
|
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||||
g_pCompositor->m_pLastMonitor->activeWorkspace);
|
|
||||||
|
|
||||||
// Do nothing if there's no previous workspace, otherwise switch to it.
|
// Do nothing if there's no previous workspace, otherwise switch to it.
|
||||||
if (PCURRENTWORKSPACE->m_iPrevWorkspaceID == -1) {
|
if (PCURRENTWORKSPACE->m_iPrevWorkspaceID == -1) {
|
||||||
Debug::log(LOG, "No previous workspace to change to");
|
Debug::log(LOG, "No previous workspace to change to");
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
||||||
|
|
||||||
|
if (const auto PWORKSPACETOCHANGETO = g_pCompositor->getWorkspaceByID(workspaceToChangeTo); PWORKSPACETOCHANGETO)
|
||||||
|
workspaceName = PWORKSPACETOCHANGETO->m_szName;
|
||||||
|
else
|
||||||
|
workspaceName = std::to_string(workspaceToChangeTo);
|
||||||
|
|
||||||
isSwitchingToPrevious = true;
|
isSwitchingToPrevious = true;
|
||||||
|
|
||||||
// If the previous workspace ID isn't reset, cycles can form when continually going
|
// If the previous workspace ID isn't reset, cycles can form when continually going
|
||||||
|
|
Loading…
Reference in a new issue