gtkpopover: Move GTK grabs to map/unmap
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 7 Apr 2023 19:42:10 +0000 (21:42 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Apr 2023 07:10:05 +0000 (09:10 +0200)
commit126b847fdd0607d90887443c75e8f3a81177b248
tree1c155115e0878d3df917a2a3e935b1a593f740e1
parentdd6ea529f8ff86734c0d36b0b54e4a1c7e66fbc0
gtkpopover: Move GTK grabs to map/unmap

Typically, a popover gets mapped when shown and unmapped when
hidden. A situation there that breaks is where the popover gets
recursively unmapped/unrealized when its root is destroyed.

In that situation, the popover does however unmap (without being
hidden first), moving the GTK grab from show/hide to map/unmap
will handle the previous situations, plus this one.

Fixes things being unclickable if e.g. a modal dialog got a
popover popped up, then got closed via Alt-F4.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5730
gtk/gtkpopover.c