Skip to content

Unblock signal on update_relative_to in Gtk.Popover

When a Gtk.Popover loses the focus, it blocks the grab_notify signal from the associated widget, and it unblocks it when it regains the focus. To know whether the signal is or not blocked, it uses the priv->grab_notify_blocked flag.

On the other hand, when the method update_relative_to() is called, all the signals connected to the old associated widget are disconnected, and connected to the new widget.

Unfortunately, the priv->grab_notify_blocked flag isn't updated, which means that if update_relative_to() is called while the Gtk.Popover doesn't have the focus (for example, because the user switched into another application), when the focus is regained, the code in window_focus_in() will see that priv->grab_notify_blocked is TRUE and will unblock the handler; but that handler wasn't blocked because the one that was blocked was disconnected when update_relative_to() was called. This shows a WARNING in the console:

GLib-GObject-WARNING **: ../../../gobject/gsignal.c:2692: handler '5146' of instance '0x556912f84f40' is not blocked

This patch fixes this.

Fix #4777 (closed)

Edited by Rastersoft

Merge request reports