layout: don't snap to self and allow same-pid snaps

fixes #8255
This commit is contained in:
Vaxry 2024-10-27 23:41:22 +00:00
parent b1120ec433
commit 6cf193e166

View file

@ -429,11 +429,10 @@ static void performSnap(Vector2D& sourcePos, Vector2D& sourceSize, PHLWINDOW DRA
CBox sourceBox = CBox{sourcePos, sourceSize}.expand(DRAGGINGBORDERSIZE); CBox sourceBox = CBox{sourcePos, sourceSize}.expand(DRAGGINGBORDERSIZE);
if (*SNAPWINDOWGAP) { if (*SNAPWINDOWGAP) {
const auto PID = DRAGGINGWINDOW->getPID();
const auto WSID = DRAGGINGWINDOW->workspaceID(); const auto WSID = DRAGGINGWINDOW->workspaceID();
for (auto& other : g_pCompositor->m_vWindows) { for (auto& other : g_pCompositor->m_vWindows) {
if (other->workspaceID() != WSID || other->getPID() == PID || !other->m_bIsMapped || other->m_bFadingOut || other->isX11OverrideRedirect()) if (other == DRAGGINGWINDOW || other->workspaceID() != WSID || !other->m_bIsMapped || other->m_bFadingOut || other->isX11OverrideRedirect())
continue; continue;
const int BORDERSIZE = other->getRealBorderSize(); const int BORDERSIZE = other->getRealBorderSize();