+gtk_bubble_window_get_rect_coords (GtkBubbleWindow *window,
+ gint *x1_out,
+ gint *y1_out,
+ gint *x2_out,
+ gint *y2_out)
+{
+ GtkBubbleWindowPrivate *priv = window->priv;
+ gint x1, x2, y1, y2;
+ GtkAllocation allocation;
+
+ x1 = y1 = x2 = y2 = 0;
+ gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+
+ if (priv->final_position == GTK_POS_TOP)
+ {
+ x1 = 0;
+ y1 = 0;
+ x2 = allocation.width;
+ y2 = allocation.height - TAIL_HEIGHT;
+ }
+ else if (priv->final_position == GTK_POS_BOTTOM)
+ {
+ x1 = 0;
+ y1 = TAIL_HEIGHT;
+ x2 = allocation.width;
+ y2 = allocation.height;
+ }
+ else if (priv->final_position == GTK_POS_LEFT)
+ {
+ x1 = 0;
+ y1 = 0;
+ x2 = allocation.width - TAIL_HEIGHT;
+ y2 = allocation.height;
+ }
+ else if (priv->final_position == GTK_POS_RIGHT)
+ {
+ x1 = TAIL_HEIGHT;
+ y1 = 0;
+ x2 = allocation.width;
+ y2 = allocation.height;
+ }
+
+ if (x1_out)
+ *x1_out = x1;
+ if (y1_out)
+ *y1_out = y1;
+ if (x2_out)
+ *x2_out = x2;
+ if (y2_out)
+ *y2_out = y2;
+}
+
+static void
+gtk_bubble_window_apply_tail_path (GtkBubbleWindow *window,
+ cairo_t *cr)
+{
+ gint initial_x, initial_y;
+ gint tip_x, tip_y;
+ gint final_x, final_y;
+
+ gtk_bubble_window_get_gap_coords (window,
+ &initial_x, &initial_y,
+ &tip_x, &tip_y,
+ &final_x, &final_y,
+ NULL);
+
+ cairo_move_to (cr, initial_x, initial_y);
+ cairo_line_to (cr, tip_x, tip_y);
+ cairo_line_to (cr, final_x, final_y);
+}
+
+static void
+gtk_bubble_window_apply_border_path (GtkBubbleWindow *window,
+ cairo_t *cr)