openbsd-ports/x11/gtk3-unico-engine/patches/patch-unico_unico-draw_c
ajacoutot efd90e4d8c Workaround a segfault with new gtk+3.
reported by and ok dcoppa@
2012-10-04 13:48:28 +00:00

104 lines
4.3 KiB
Plaintext

$OpenBSD: patch-unico_unico-draw_c,v 1.1 2012/10/04 13:48:28 ajacoutot Exp $
Disable rounded corner code that crashes on newer gtk+3.
--- unico/unico-draw.c.orig Thu Mar 29 16:26:20 2012
+++ unico/unico-draw.c Thu Oct 4 15:27:44 2012
@@ -531,8 +531,8 @@ unico_draw_frame_gap (DRAW_ARGS,
{
GtkBorder border;
GtkBorder *outer_border;
- GtkCssBorderCornerRadius *top_left_radius, *top_right_radius;
- GtkCssBorderCornerRadius *bottom_left_radius, *bottom_right_radius;
+ /*GtkCssBorderCornerRadius *top_left_radius, *top_right_radius;
+ GtkCssBorderCornerRadius *bottom_left_radius, *bottom_right_radius;*/
GtkJunctionSides junction;
GtkStateFlags state;
gboolean has_outer_stroke = FALSE;
@@ -544,13 +544,14 @@ unico_draw_frame_gap (DRAW_ARGS,
state = gtk_theming_engine_get_state (engine);
+ /* NOTE: Border radius is disabled due to it not working in GTK+ 3.5 */
gtk_theming_engine_get (engine, state,
/* Can't use border-radius as it's an int for
* backwards compat */
- "border-top-left-radius", &top_left_radius,
+ /*"border-top-left-radius", &top_left_radius,
"border-top-right-radius", &top_right_radius,
"border-bottom-right-radius", &bottom_right_radius,
- "border-bottom-left-radius", &bottom_left_radius,
+ "border-bottom-left-radius", &bottom_left_radius,*/
"-unico-outer-stroke-width", &outer_border,
NULL);
gtk_theming_engine_get_border (engine, state, &border);
@@ -575,11 +576,11 @@ unico_draw_frame_gap (DRAW_ARGS,
hc += outer_border->top;
}
- if (xy0_gap < _gtk_css_number_get (&top_left_radius->horizontal, width))
+ /*if (xy0_gap < _gtk_css_number_get (&top_left_radius->horizontal, width))
junction |= GTK_JUNCTION_CORNER_TOPLEFT;
if (xy1_gap > width - _gtk_css_number_get (&top_right_radius->horizontal, width))
- junction |= GTK_JUNCTION_CORNER_TOPRIGHT;
+ junction |= GTK_JUNCTION_CORNER_TOPRIGHT;*/
break;
default:
@@ -597,11 +598,11 @@ unico_draw_frame_gap (DRAW_ARGS,
hc += outer_border->bottom;
}
- if (xy0_gap < _gtk_css_number_get (&bottom_left_radius->horizontal, width))
+ /*if (xy0_gap < _gtk_css_number_get (&bottom_left_radius->horizontal, width))
junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;
if (xy1_gap > width - _gtk_css_number_get (&bottom_right_radius->horizontal, width))
- junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+ junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;*/
break;
case GTK_POS_LEFT:
@@ -617,11 +618,11 @@ unico_draw_frame_gap (DRAW_ARGS,
hc = MAX (xy1_gap - xy0_gap - (outer_border->top + outer_border->bottom) - (border.top + border.bottom), 0);
}
- if (xy0_gap < _gtk_css_number_get (&top_left_radius->vertical, height))
+ /*if (xy0_gap < _gtk_css_number_get (&top_left_radius->vertical, height))
junction |= GTK_JUNCTION_CORNER_TOPLEFT;
if (xy1_gap > height - _gtk_css_number_get (&bottom_left_radius->vertical, height))
- junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;
+ junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;*/
break;
case GTK_POS_RIGHT:
@@ -638,11 +639,11 @@ unico_draw_frame_gap (DRAW_ARGS,
hc = MAX (xy1_gap - xy0_gap - (outer_border->top + outer_border->bottom) - (border.top + border.bottom), 0);
}
- if (xy0_gap < _gtk_css_number_get (&top_right_radius->vertical, height))
+ /*if (xy0_gap < _gtk_css_number_get (&top_right_radius->vertical, height))
junction |= GTK_JUNCTION_CORNER_TOPRIGHT;
if (xy1_gap > height - _gtk_css_number_get (&bottom_right_radius->vertical, height))
- junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+ junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;*/
break;
}
@@ -660,10 +661,10 @@ unico_draw_frame_gap (DRAW_ARGS,
cairo_restore (cr);
- g_free (top_left_radius);
+ /*g_free (top_left_radius);
g_free (top_right_radius);
g_free (bottom_right_radius);
- g_free (bottom_left_radius);
+ g_free (bottom_left_radius);*/
gtk_border_free (outer_border);
}