GtkPopover: Survive attach_widget == NULL

We can't render a tail, but otherwise things should just work.
This will be useful in glade.
This commit is contained in:
Matthias Clasen
2014-11-13 23:09:21 -05:00
parent 61286d5927
commit 49cf85509a

View File

@ -639,6 +639,9 @@ gtk_popover_apply_tail_path (GtkPopover *popover,
gint tip_x, tip_y;
gint final_x, final_y;
if (!popover->priv->widget)
return;
cairo_set_line_width (cr, 1);
gtk_popover_get_gap_coords (popover,
&initial_x, &initial_y,
@ -843,6 +846,8 @@ gtk_popover_draw (GtkWidget *widget,
rect_x2 - rect_x1,
rect_y2 - rect_y1);
if (popover->priv->widget)
{
gtk_popover_get_gap_coords (popover,
&initial_x, &initial_y,
NULL, NULL,
@ -866,6 +871,13 @@ gtk_popover_draw (GtkWidget *widget,
rect_x2 - rect_x1, rect_y2 - rect_y1,
gap_side,
gap_start, gap_end);
}
else
{
gtk_render_frame (context, cr,
rect_x1, rect_y1,
rect_x2 - rect_x1, rect_y2 - rect_y1);
}
/* Clip to the arrow shape */
cairo_save (cr);