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:
Aqa-Ib 2024-10-16 09:59:47 +00:00 committed by GitHub
parent 01c2ff34dd
commit ace803948a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.