diff options
author | Parola Marco <[email protected]> | 2024-09-05 18:29:33 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-05 17:29:33 +0100 |
commit | 4a42c5ed20a6852e5e51c0f3893024f3b5c03500 (patch) | |
tree | f7f972ebcfa5abf74c5a91264abf7d3626ee035b /src/desktop | |
parent | bd6d6e7f3378c08fe48c179ba4ec3517fe10ae3f (diff) | |
download | Hyprland-4a42c5ed20a6852e5e51c0f3893024f3b5c03500.tar.gz Hyprland-4a42c5ed20a6852e5e51c0f3893024f3b5c03500.zip |
config: Add a variable to prevent groups from merging after being dragged (#7650)
* config: Add a variable to prevent groups from merging after being dragged
* Fixed code style for [f777f028]
Diffstat (limited to 'src/desktop')
-rw-r--r-- | src/desktop/Window.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index a9e389a6..cc5b48af 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -951,12 +951,16 @@ int CWindow::getGroupSize() { } bool CWindow::canBeGroupedInto(PHLWINDOW pWindow) { + static auto ALLOWGROUPMERGE = CConfigValue<Hyprlang::INT>("group:merge_groups_on_drag"); + bool isGroup = m_sGroupData.pNextWindow; + bool disallowDragIntoGroup = g_pInputManager->m_bWasDraggingWindow && isGroup && !bool(*ALLOWGROUPMERGE); return !g_pKeybindManager->m_bGroupsLocked // global group lock disengaged && ((m_eGroupRules & GROUP_INVADE && m_bFirstMap) // window ignore local group locks, or || (!pWindow->getGroupHead()->m_sGroupData.locked // target unlocked && !(m_sGroupData.pNextWindow.lock() && getGroupHead()->m_sGroupData.locked))) // source unlocked or isn't group && !m_sGroupData.deny // source is not denied entry - && !(m_eGroupRules & GROUP_BARRED && m_bFirstMap); // group rule doesn't prevent adding window + && !(m_eGroupRules & GROUP_BARRED && m_bFirstMap) // group rule doesn't prevent adding window + && !disallowDragIntoGroup; // config allows groups to be merged } PHLWINDOW CWindow::getGroupWindowByIndex(int index) { |