Commit 5c37ef21 authored by Michael Natterer's avatar Michael Natterer 😴

app: restore ungrab on unmap in GimpDial

which I broke when splitting classes.
parent 98d6f442
......@@ -52,7 +52,6 @@ struct _GimpCirclePrivate
GimpCircleBackground background;
GdkWindow *event_window;
guint has_grab : 1;
};
......@@ -267,12 +266,6 @@ gimp_circle_unmap (GtkWidget *widget)
{
GimpCircle *circle = GIMP_CIRCLE (widget);
if (circle->priv->has_grab)
{
gtk_grab_remove (widget);
circle->priv->has_grab = FALSE;
}
if (circle->priv->event_window)
gdk_window_hide (circle->priv->event_window);
......
......@@ -67,7 +67,7 @@ struct _GimpDialPrivate
DialTarget target;
gdouble last_angle;
guint has_grab : 1;
gboolean has_grab;
};
......@@ -81,6 +81,7 @@ static void gimp_dial_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gimp_dial_unmap (GtkWidget *widget);
static gboolean gimp_dial_expose_event (GtkWidget *widget,
GdkEventExpose *event);
static gboolean gimp_dial_button_press_event (GtkWidget *widget,
......@@ -113,6 +114,7 @@ gimp_dial_class_init (GimpDialClass *klass)
object_class->get_property = gimp_dial_get_property;
object_class->set_property = gimp_dial_set_property;
widget_class->unmap = gimp_dial_unmap;
widget_class->expose_event = gimp_dial_expose_event;
widget_class->button_press_event = gimp_dial_button_press_event;
widget_class->button_release_event = gimp_dial_button_release_event;
......@@ -236,6 +238,20 @@ gimp_dial_get_property (GObject *object,
}
}
static void
gimp_dial_unmap (GtkWidget *widget)
{
GimpDial *dial = GIMP_DIAL (widget);
if (dial->priv->has_grab)
{
gtk_grab_remove (widget);
dial->priv->has_grab = FALSE;
}
GTK_WIDGET_CLASS (parent_class)->unmap (widget);
}
static gboolean
gimp_dial_expose_event (GtkWidget *widget,
GdkEventExpose *event)
......@@ -249,7 +265,6 @@ gimp_dial_expose_event (GtkWidget *widget,
GtkAllocation allocation;
gint size;
cairo_t *cr;
gint x, y;
g_object_get (widget,
"size", &size,
......
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