| Summary: | window snapping might snap to invisible windows during resize | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Flupp <Flupp+bugs.kde.org> |
| Component: | core | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | nate |
| Priority: | NOR | ||
| Version First Reported In: | 5.24.5 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Nice catch, feel free to submit a merge request to fix this. |
When resizing a window with window snapping enabled, KWin considers, e.g., windows from other activities as snapping target although they are currently invisible. This does not occur when a window is repositioned instead of resized. In the source code, AFAIS, the snapping implementations for repositioning and resizing employ very different filters to determine potential snapping targets (see `src/workspace.cpp`): ```C++ QPoint Workspace::adjustClientPosition(AbstractClient* c, QPoint pos, bool unrestricted, double snapAdjust) { // […] for (auto l = m_allClients.constBegin(); l != m_allClients.constEnd(); ++l) { if ((*l) == c) continue; if ((*l)->isMinimized() || (*l)->isShade()) continue; if (!(*l)->isShown()) continue; if (!(*l)->isOnCurrentDesktop()) continue; // wrong virtual desktop if (!(*l)->isOnCurrentActivity()) continue; // wrong activity if ((*l)->isDesktop() || (*l)->isSplash() || (*l)->isNotification() || (*l)->isCriticalNotification() || (*l)->isOnScreenDisplay()) continue; // [adapt position] […] QRect Workspace::adjustClientSize(AbstractClient* c, QRect moveResizeGeom, Gravity gravity) { // […] for (auto l = m_allClients.constBegin(); l != m_allClients.constEnd(); ++l) { if ((*l)->isOnCurrentDesktop() && !(*l)->isMinimized() && (*l) != c) { // [adapt size] […] ```