mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 23:46:00 +01:00
groups: ensure consistency in dispatcher behavior with global group lock (#3531)
This commit is contained in:
parent
d83357f497
commit
34455844e9
1 changed files with 16 additions and 2 deletions
|
@ -2019,7 +2019,10 @@ void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string&
|
||||||
void CKeybindManager::moveIntoGroup(std::string args) {
|
void CKeybindManager::moveIntoGroup(std::string args) {
|
||||||
char arg = args[0];
|
char arg = args[0];
|
||||||
|
|
||||||
static auto* const BIGNOREGROUPLOCK = &g_pConfigManager->getConfigValuePtr("binds:ignore_group_lock")->intValue;
|
static auto* const PIGNOREGROUPLOCK = &g_pConfigManager->getConfigValuePtr("binds:ignore_group_lock")->intValue;
|
||||||
|
|
||||||
|
if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!isDirection(args)) {
|
if (!isDirection(args)) {
|
||||||
Debug::log(ERR, "Cannot move into group in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
|
Debug::log(ERR, "Cannot move into group in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
|
||||||
|
@ -2037,13 +2040,18 @@ void CKeybindManager::moveIntoGroup(std::string args) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Do not move window into locked group if binds:ignore_group_lock is false
|
// Do not move window into locked group if binds:ignore_group_lock is false
|
||||||
if (!*BIGNOREGROUPLOCK && (PWINDOWINDIR->getGroupHead()->m_sGroupData.locked || (PWINDOW->m_sGroupData.pNextWindow && PWINDOW->getGroupHead()->m_sGroupData.locked)))
|
if (!*PIGNOREGROUPLOCK && (PWINDOWINDIR->getGroupHead()->m_sGroupData.locked || (PWINDOW->m_sGroupData.pNextWindow && PWINDOW->getGroupHead()->m_sGroupData.locked)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
moveWindowIntoGroup(PWINDOW, PWINDOWINDIR);
|
moveWindowIntoGroup(PWINDOW, PWINDOWINDIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeybindManager::moveOutOfGroup(std::string args) {
|
void CKeybindManager::moveOutOfGroup(std::string args) {
|
||||||
|
static auto* const PIGNOREGROUPLOCK = &g_pConfigManager->getConfigValuePtr("binds:ignore_group_lock")->intValue;
|
||||||
|
|
||||||
|
if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked)
|
||||||
|
return;
|
||||||
|
|
||||||
const auto PWINDOW = g_pCompositor->m_pLastWindow;
|
const auto PWINDOW = g_pCompositor->m_pLastWindow;
|
||||||
|
|
||||||
if (!PWINDOW || !PWINDOW->m_sGroupData.pNextWindow)
|
if (!PWINDOW || !PWINDOW->m_sGroupData.pNextWindow)
|
||||||
|
@ -2065,6 +2073,12 @@ void CKeybindManager::moveWindowOrGroup(std::string args) {
|
||||||
const auto PWINDOW = g_pCompositor->m_pLastWindow;
|
const auto PWINDOW = g_pCompositor->m_pLastWindow;
|
||||||
if (!PWINDOW || PWINDOW->m_bIsFullscreen)
|
if (!PWINDOW || PWINDOW->m_bIsFullscreen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked) {
|
||||||
|
g_pLayoutManager->getCurrentLayout()->moveWindowTo(PWINDOW, args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto PWINDOWINDIR = g_pCompositor->getWindowInDirection(PWINDOW, arg);
|
const auto PWINDOWINDIR = g_pCompositor->getWindowInDirection(PWINDOW, arg);
|
||||||
|
|
||||||
const bool ISWINDOWGROUP = PWINDOW->m_sGroupData.pNextWindow;
|
const bool ISWINDOWGROUP = PWINDOW->m_sGroupData.pNextWindow;
|
||||||
|
|
Loading…
Reference in a new issue