Commit 2a984ef5 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

Bug 612618 - Font selection remains visible

Connect to "grab-notify" and "grab-broken-event" and close the popup
when the grab is lost.
parent ff1da59f
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment