mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 09:09:48 +01:00
fix refocus on same workspace
This commit is contained in:
parent
fa2d81b649
commit
151e013241
1 changed files with 5 additions and 3 deletions
|
@ -575,9 +575,9 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
|
|
||||||
// Workspace_back_and_forth being enabled means that an attempt to switch to
|
// Workspace_back_and_forth being enabled means that an attempt to switch to
|
||||||
// the current workspace will instead switch to the previous.
|
// the current workspace will instead switch to the previous.
|
||||||
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(
|
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||||
g_pCompositor->m_pLastMonitor->activeWorkspace);
|
|
||||||
static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue;
|
static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue;
|
||||||
|
|
||||||
if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) {
|
if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) {
|
||||||
|
|
||||||
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
||||||
|
@ -588,7 +588,9 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
static auto *const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
|
static auto *const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
|
||||||
if (!*PALLOWWORKSPACECYCLES)
|
if (!*PALLOWWORKSPACECYCLES)
|
||||||
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
||||||
}
|
|
||||||
|
} else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo)
|
||||||
|
return;
|
||||||
|
|
||||||
// remove constraints
|
// remove constraints
|
||||||
g_pInputManager->unconstrainMouse();
|
g_pInputManager->unconstrainMouse();
|
||||||
|
|
Loading…
Reference in a new issue