summaryrefslogtreecommitdiff
path: root/eel/eel-canvas-rect-ellipse.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-31 07:16:33 +0200
committerJasmine Hassan <[email protected]>2012-11-02 16:25:25 +0200
commitea7bc87871154c2239f25d84191add2d4b630022 (patch)
treecc0b5ae5daec37c715d4cfa3f60eea8be72b7811 /eel/eel-canvas-rect-ellipse.c
parentec92a520965f420af7d00ad8e347f62106bbc578 (diff)
downloadcaja-ea7bc87871154c2239f25d84191add2d4b630022.tar.bz2
caja-ea7bc87871154c2239f25d84191add2d4b630022.tar.xz
[eel] Use GdkRegion on GTK2, cairo_region_t on GTK3
http://git.gnome.org/browse/nautilus/commit/?id=3b671558f1d8ac1ee72e8af13d4ede6ab549a400
Diffstat (limited to 'eel/eel-canvas-rect-ellipse.c')
-rw-r--r--eel/eel-canvas-rect-ellipse.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/eel/eel-canvas-rect-ellipse.c b/eel/eel-canvas-rect-ellipse.c
index c637769d..b78c47a7 100644
--- a/eel/eel-canvas-rect-ellipse.c
+++ b/eel/eel-canvas-rect-ellipse.c
@@ -1012,9 +1012,8 @@ eel_canvas_rect_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose
{
if ((re->fill_color & 0xff) != 255)
{
- GdkRectangle *rectangles;
gint i, n_rectangles;
- GdkRectangle draw_rect;
+ GdkRectangle draw_rect, rect;
GdkRectangle part;
draw_rect.x = cx1;
@@ -1024,13 +1023,19 @@ eel_canvas_rect_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose
/* For alpha mode, only render the parts of the region
that are actually exposed */
- gdk_region_get_rectangles (expose->region,
- &rectangles,
- &n_rectangles);
-
+#if GTK_CHECK_VERSION(3, 0, 0)
+ n_rectangles = cairo_region_num_rectangles (expose->region);
+#else
+ gdk_region_get_rectangles (expose->region, &rect, &n_rectangles);
+#endif
for (i = 0; i < n_rectangles; i++)
{
- if (gdk_rectangle_intersect (&rectangles[i],
+#if GTK_CHECK_VERSION(3, 0, 0)
+ cairo_region_get_rectangle (expose->region, i, &rect);
+#else
+ rect = &rect[i];
+#endif
+ if (gdk_rectangle_intersect (&rect,
&draw_rect,
&part))
{
@@ -1041,8 +1046,9 @@ eel_canvas_rect_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose
re->fill_color);
}
}
-
- g_free (rectangles);
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ g_free (rect);
+#endif
}
else
{