mirror of https://github.com/GNOME/gimp.git
Bug 612618 - Font selection remains visible
Connect to "grab-notify" and "grab-broken-event" and close the popup when the grab is lost.
This commit is contained in:
parent
ff1da59f33
commit
2a984ef51f
|
@ -176,6 +176,23 @@ gimp_container_popup_finalize (GObject *object)
|
|||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_popup_grab_notify (GtkWidget *widget,
|
||||
gboolean was_grabbed)
|
||||
{
|
||||
if (! was_grabbed)
|
||||
g_signal_emit (widget, popup_signals[CANCEL], 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_container_popup_grab_broken_event (GtkWidget *widget,
|
||||
GdkEventGrabBroken *event)
|
||||
{
|
||||
gimp_container_popup_grab_notify (widget, FALSE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_popup_map (GtkWidget *widget)
|
||||
{
|
||||
|
@ -194,6 +211,14 @@ gimp_container_popup_map (GtkWidget *widget)
|
|||
GDK_CURRENT_TIME) == 0)
|
||||
{
|
||||
gtk_grab_add (widget);
|
||||
|
||||
g_signal_connect (widget, "grab-notify",
|
||||
G_CALLBACK (gimp_container_popup_grab_notify),
|
||||
widget);
|
||||
g_signal_connect (widget, "grab-broken-event",
|
||||
G_CALLBACK (gimp_container_popup_grab_broken_event),
|
||||
widget);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue