Hyprland
Hyprland copied to clipboard
Fix wrong surface local coord for layer surface above an xwayland window
This PR fixes an incorrect selection rectangle issue that occurs when using slurp with a focused XWayland application.
While this represents a rare edge case, it consistently reproduces under the following technical circumstances:
- As a region selector,
slurprequires users to maintain mouse button pressure until selection completion - This action triggers special Drag-and-Drop focus retention logic, where
pFoundWindowmay be incorrectly set for layer surfaces (whichslurputilizes) - When
pFoundWindowreferencesm_lastWindowfrom an XWayland instance withforce_zero_scalingenabled, the special XWayland zero-scale handling branch activates - The scaling effects intended for
m_lastWindowerroneously apply to the current layer surface, corrupting surface-local coordinates
The solution prevents pFoundWindow assignment when encountering layer surfaces, which represents a logically sound approach.
https://github.com/user-attachments/assets/4f0269d7-ccff-4777-9970-8c2a5d7d33db