From 617f23b7eb7c770ac596305a8913103c79a125e9 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 12 Nov 2013 12:41:24 +0100 Subject: [PATCH] bubblewindow: check the border-radius when rendering the bubble tail. --- gtk/gtkbubblewindow.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtk/gtkbubblewindow.c b/gtk/gtkbubblewindow.c index b8f25d882a..b00b4fa22f 100644 --- a/gtk/gtkbubblewindow.c +++ b/gtk/gtkbubblewindow.c @@ -256,10 +256,16 @@ gtk_bubble_window_get_gap_coords (GtkBubbleWindow *window, gint final_x, final_y; GtkPositionType gap_side; GtkAllocation allocation; + gint border_radius; gtk_bubble_window_get_pointed_to_coords (window, &x, &y, NULL); gtk_widget_get_allocation (GTK_WIDGET (window), &allocation); + gtk_style_context_get (gtk_widget_get_style_context (GTK_WIDGET (window)), + gtk_widget_get_state_flags (GTK_WIDGET (window)), + GTK_STYLE_PROPERTY_BORDER_RADIUS, &border_radius, + NULL); + base = tip = 0; gap_side = GTK_POS_LEFT; @@ -287,28 +293,28 @@ gtk_bubble_window_get_gap_coords (GtkBubbleWindow *window, if (POS_IS_VERTICAL (priv->final_position)) { initial_x = CLAMP (x - priv->win_x - TAIL_GAP_WIDTH / 2, - 0, allocation.width - TAIL_GAP_WIDTH); + border_radius, allocation.width - TAIL_GAP_WIDTH); initial_y = base; tip_x = CLAMP (x - priv->win_x, 0, allocation.width); tip_y = tip; final_x = CLAMP (x - priv->win_x + TAIL_GAP_WIDTH / 2, - TAIL_GAP_WIDTH, allocation.width); + TAIL_GAP_WIDTH, allocation.width - border_radius); final_y = base; } else { initial_x = base; initial_y = CLAMP (y - priv->win_y - TAIL_GAP_WIDTH / 2, - 0, allocation.height - TAIL_GAP_WIDTH); + border_radius, allocation.height - TAIL_GAP_WIDTH); tip_x = tip; tip_y = CLAMP (y - priv->win_y, 0, allocation.height); final_x = base; final_y = CLAMP (y - priv->win_y + TAIL_GAP_WIDTH / 2, - TAIL_GAP_WIDTH, allocation.height); + TAIL_GAP_WIDTH, allocation.height - border_radius); } if (initial_x_out)