This mirrors the x11 implementation, allowing the pointer to move correctly into overlapping windows.