Skip to content

[46] wayland/popup: Only close popups if press count drops from 1 to 0

Jonas Ådahl requested to merge cherry-pick-79a79b34 into gnome-46

We close wayland popups when a button or touch release happens outside of the grab, except we don't want to close them when that button release is actually the release of the press that was opening the grab in the first place.

We never see the press event that opened the grab, so the first event we see is actually always a release. Make sure to not close the popup on that event, and instead only close the popup if we see the press count drop from 1 to 0.

This fixes a bug where popup would close right after they open. To reproduce, click to open a popup, hold pressed and move the cursor over shell chrome, then release. Or alternatively test with a popup that gets opened with a long-press gesture (eg. long touch long press on libadwaita tabs), just doing the touch long-press and then release.

Part-of: !3631 (merged)

(cherry picked from commit 79a79b34)

Merge request reports