mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 09:25:59 +01:00
groups: add merge_groups_on_groupbar (#8362)
This commit is contained in:
parent
97a309b784
commit
8f42401aa8
6 changed files with 24 additions and 26 deletions
|
@ -778,6 +778,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
||||||
.type = CONFIG_OPTION_BOOL,
|
.type = CONFIG_OPTION_BOOL,
|
||||||
.data = SConfigOptionDescription::SBoolData{true},
|
.data = SConfigOptionDescription::SBoolData{true},
|
||||||
},
|
},
|
||||||
|
SConfigOptionDescription{
|
||||||
|
.value = "group:merge_groups_on_groupbar",
|
||||||
|
.description = "whether one group will be merged with another when dragged into its groupbar",
|
||||||
|
.type = CONFIG_OPTION_BOOL,
|
||||||
|
.data = SConfigOptionDescription::SBoolData{true},
|
||||||
|
},
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "general:col.border_active",
|
.value = "general:col.border_active",
|
||||||
.description = "border color for inactive windows",
|
.description = "border color for inactive windows",
|
||||||
|
|
|
@ -381,6 +381,7 @@ CConfigManager::CConfigManager() {
|
||||||
m_pConfig->addConfigValue("group:insert_after_current", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:insert_after_current", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:focus_removed_window", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:focus_removed_window", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:merge_groups_on_drag", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:merge_groups_on_drag", Hyprlang::INT{1});
|
||||||
|
m_pConfig->addConfigValue("group:merge_groups_on_groupbar", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:merge_floated_into_tiled_on_groupbar", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("group:merge_floated_into_tiled_on_groupbar", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("group:auto_group", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:auto_group", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:drag_into_group", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:drag_into_group", Hyprlang::INT{1});
|
||||||
|
|
|
@ -310,11 +310,6 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_vOverrideFocalPoint && g_pInputManager->m_bWasDraggingWindow) {
|
|
||||||
if (OPENINGON->pWindow->checkInputOnDecos(INPUT_TYPE_DRAG_END, MOUSECOORDS, pWindow))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get the node under our cursor
|
// get the node under our cursor
|
||||||
|
|
||||||
m_lDwindleNodesData.push_back(SDwindleNodeData());
|
m_lDwindleNodesData.push_back(SDwindleNodeData());
|
||||||
|
|
|
@ -344,12 +344,6 @@ void IHyprLayout::onEndDragWindow() {
|
||||||
|
|
||||||
if (pWindow->m_sGroupData.pNextWindow.lock() && DRAGGINGWINDOW->canBeGroupedInto(pWindow) && *PDRAGINTOGROUP == 1 && !FLOATEDINTOTILED) {
|
if (pWindow->m_sGroupData.pNextWindow.lock() && DRAGGINGWINDOW->canBeGroupedInto(pWindow) && *PDRAGINTOGROUP == 1 && !FLOATEDINTOTILED) {
|
||||||
|
|
||||||
if (DRAGGINGWINDOW->m_bDraggingTiled) {
|
|
||||||
changeWindowFloatingMode(DRAGGINGWINDOW);
|
|
||||||
DRAGGINGWINDOW->m_vLastFloatingSize = m_vDraggingWindowOriginalFloatSize;
|
|
||||||
DRAGGINGWINDOW->m_bDraggingTiled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DRAGGINGWINDOW->m_sGroupData.pNextWindow) {
|
if (DRAGGINGWINDOW->m_sGroupData.pNextWindow) {
|
||||||
PHLWINDOW next = DRAGGINGWINDOW->m_sGroupData.pNextWindow.lock();
|
PHLWINDOW next = DRAGGINGWINDOW->m_sGroupData.pNextWindow.lock();
|
||||||
while (next != DRAGGINGWINDOW) {
|
while (next != DRAGGINGWINDOW) {
|
||||||
|
@ -360,7 +354,9 @@ void IHyprLayout::onEndDragWindow() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DRAGGINGWINDOW->m_bIsFloating = pWindow->m_bIsFloating; // match the floating state of the window
|
DRAGGINGWINDOW->m_bIsFloating = pWindow->m_bIsFloating; // match the floating state of the window
|
||||||
|
DRAGGINGWINDOW->m_vLastFloatingSize = m_vDraggingWindowOriginalFloatSize;
|
||||||
|
DRAGGINGWINDOW->m_bDraggingTiled = false;
|
||||||
|
|
||||||
if (pWindow->m_bIsFloating)
|
if (pWindow->m_bIsFloating)
|
||||||
g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, pWindow->m_vRealSize.goal()); // match the size of the window
|
g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, pWindow->m_vRealSize.goal()); // match the size of the window
|
||||||
|
|
|
@ -101,21 +101,15 @@ void CHyprMasterLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dire
|
||||||
PNODE->workspaceID = pWindow->workspaceID();
|
PNODE->workspaceID = pWindow->workspaceID();
|
||||||
PNODE->pWindow = pWindow;
|
PNODE->pWindow = pWindow;
|
||||||
|
|
||||||
const auto WINDOWSONWORKSPACE = getNodesOnWorkspace(PNODE->workspaceID);
|
const auto WINDOWSONWORKSPACE = getNodesOnWorkspace(PNODE->workspaceID);
|
||||||
static auto PMFACT = CConfigValue<Hyprlang::FLOAT>("master:mfact");
|
static auto PMFACT = CConfigValue<Hyprlang::FLOAT>("master:mfact");
|
||||||
float lastSplitPercent = *PMFACT;
|
float lastSplitPercent = *PMFACT;
|
||||||
|
|
||||||
auto OPENINGON = isWindowTiled(g_pCompositor->m_pLastWindow.lock()) && g_pCompositor->m_pLastWindow->m_pWorkspace == pWindow->m_pWorkspace ?
|
auto OPENINGON = isWindowTiled(g_pCompositor->m_pLastWindow.lock()) && g_pCompositor->m_pLastWindow->m_pWorkspace == pWindow->m_pWorkspace ?
|
||||||
getNodeFromWindow(g_pCompositor->m_pLastWindow.lock()) :
|
getNodeFromWindow(g_pCompositor->m_pLastWindow.lock()) :
|
||||||
getMasterNodeOnWorkspace(pWindow->workspaceID());
|
getMasterNodeOnWorkspace(pWindow->workspaceID());
|
||||||
|
|
||||||
const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal();
|
|
||||||
|
|
||||||
if (g_pInputManager->m_bWasDraggingWindow && OPENINGON) {
|
|
||||||
if (OPENINGON->pWindow->checkInputOnDecos(INPUT_TYPE_DRAG_END, MOUSECOORDS, pWindow))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal();
|
||||||
static auto PDROPATCURSOR = CConfigValue<Hyprlang::INT>("master:drop_at_cursor");
|
static auto PDROPATCURSOR = CConfigValue<Hyprlang::INT>("master:drop_at_cursor");
|
||||||
eOrientation orientation = getDynamicOrientation(pWindow->m_pWorkspace);
|
eOrientation orientation = getDynamicOrientation(pWindow->m_pWorkspace);
|
||||||
const auto NODEIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *PNODE);
|
const auto NODEIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *PNODE);
|
||||||
|
|
|
@ -405,10 +405,16 @@ bool CHyprGroupBarDecoration::onEndWindowDragOnDeco(const Vector2D& pos, PHLWIND
|
||||||
static auto PSTACKED = CConfigValue<Hyprlang::INT>("group:groupbar:stacked");
|
static auto PSTACKED = CConfigValue<Hyprlang::INT>("group:groupbar:stacked");
|
||||||
static auto PDRAGINTOGROUP = CConfigValue<Hyprlang::INT>("group:drag_into_group");
|
static auto PDRAGINTOGROUP = CConfigValue<Hyprlang::INT>("group:drag_into_group");
|
||||||
static auto PMERGEFLOATEDINTOTILEDONGROUPBAR = CConfigValue<Hyprlang::INT>("group:merge_floated_into_tiled_on_groupbar");
|
static auto PMERGEFLOATEDINTOTILEDONGROUPBAR = CConfigValue<Hyprlang::INT>("group:merge_floated_into_tiled_on_groupbar");
|
||||||
|
static auto PMERGEGROUPSONGROUPBAR = CConfigValue<Hyprlang::INT>("group:merge_groups_on_groupbar");
|
||||||
const bool FLOATEDINTOTILED = !m_pWindow->m_bIsFloating && !pDraggedWindow->m_bDraggingTiled;
|
const bool FLOATEDINTOTILED = !m_pWindow->m_bIsFloating && !pDraggedWindow->m_bDraggingTiled;
|
||||||
|
|
||||||
if (!pDraggedWindow->canBeGroupedInto(m_pWindow.lock()) || (*PDRAGINTOGROUP != 1 && *PDRAGINTOGROUP != 2) || (FLOATEDINTOTILED && !*PMERGEFLOATEDINTOTILEDONGROUPBAR))
|
g_pInputManager->m_bWasDraggingWindow = false;
|
||||||
|
|
||||||
|
if (!pDraggedWindow->canBeGroupedInto(m_pWindow.lock()) || (*PDRAGINTOGROUP != 1 && *PDRAGINTOGROUP != 2) || (FLOATEDINTOTILED && !*PMERGEFLOATEDINTOTILEDONGROUPBAR) ||
|
||||||
|
(!*PMERGEGROUPSONGROUPBAR && pDraggedWindow->m_sGroupData.pNextWindow.lock() && m_pWindow->m_sGroupData.pNextWindow.lock())) {
|
||||||
|
g_pInputManager->m_bWasDraggingWindow = true;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const float BARRELATIVE = *PSTACKED ? pos.y - assignedBoxGlobal().y - (m_fBarHeight + BAR_PADDING_OUTER_VERT) / 2 : pos.x - assignedBoxGlobal().x - m_fBarWidth / 2;
|
const float BARRELATIVE = *PSTACKED ? pos.y - assignedBoxGlobal().y - (m_fBarHeight + BAR_PADDING_OUTER_VERT) / 2 : pos.x - assignedBoxGlobal().x - m_fBarWidth / 2;
|
||||||
const float BARSIZE = *PSTACKED ? m_fBarHeight + BAR_PADDING_OUTER_VERT : m_fBarWidth + BAR_HORIZONTAL_PADDING;
|
const float BARSIZE = *PSTACKED ? m_fBarHeight + BAR_PADDING_OUTER_VERT : m_fBarWidth + BAR_HORIZONTAL_PADDING;
|
||||||
|
|
Loading…
Reference in a new issue