mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 11:45:58 +01:00
layout: enable group rules for new floating windows (#8122)
* layout: enable group rules for new floating windows * fix comment * do not apply group rules to a new floating window if it shouldBeFloated. fixes child windows * comment
This commit is contained in:
parent
01c2ff34dd
commit
ace803948a
1 changed files with 3 additions and 1 deletions
|
@ -82,6 +82,8 @@ void IHyprLayout::onWindowRemovedFloating(PHLWINDOW pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {
|
void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {
|
||||||
|
if (!g_pXWaylandManager->shouldBeFloated(pWindow)) // do not apply group rules to child windows
|
||||||
|
pWindow->applyGroupRules();
|
||||||
|
|
||||||
CBox desiredGeometry = {0};
|
CBox desiredGeometry = {0};
|
||||||
g_pXWaylandManager->getGeometryForWindow(pWindow, &desiredGeometry);
|
g_pXWaylandManager->getGeometryForWindow(pWindow, &desiredGeometry);
|
||||||
|
@ -193,7 +195,7 @@ bool IHyprLayout::onWindowCreatedAutoGroup(PHLWINDOW pWindow) {
|
||||||
if (*PAUTOGROUP // check if auto_group is enabled.
|
if (*PAUTOGROUP // check if auto_group is enabled.
|
||||||
&& OPENINGON->m_sGroupData.pNextWindow.lock() // check if OPENINGON is a group.
|
&& OPENINGON->m_sGroupData.pNextWindow.lock() // check if OPENINGON is a group.
|
||||||
&& pWindow->canBeGroupedInto(OPENINGON) // check if the new window can be grouped into OPENINGON.
|
&& pWindow->canBeGroupedInto(OPENINGON) // check if the new window can be grouped into OPENINGON.
|
||||||
&& !g_pXWaylandManager->shouldBeFloated(pWindow) // fixes the popups of XWayland programs running in a floating group.
|
&& !g_pXWaylandManager->shouldBeFloated(pWindow) // don't group child windows. Fix for floated groups. Tiled groups don't need this because we check if !denied.
|
||||||
&& !denied) { // don't group a new floated window into a tiled group (for convenience).
|
&& !denied) { // don't group a new floated window into a tiled group (for convenience).
|
||||||
|
|
||||||
pWindow->m_bIsFloating = OPENINGON->m_bIsFloating; // match the floating state. Needed to autogroup a new tiled window into a floated group.
|
pWindow->m_bIsFloating = OPENINGON->m_bIsFloating; // match the floating state. Needed to autogroup a new tiled window into a floated group.
|
||||||
|
|
Loading…
Reference in a new issue