summaryrefslogtreecommitdiff
path: root/capplets/display/scrollarea.c
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2014-11-05 16:42:52 +0300
committerDenis Gorodnichev <[email protected]>2014-11-05 16:45:02 +0300
commit488122614cc873bbea777853a48ae20e83ee18af (patch)
tree4946dd0ea5213fd99144f9561e287dadf5c52f0d /capplets/display/scrollarea.c
parent635fbdf74108548b9e12ff7ba1d2eaad05eb31e6 (diff)
downloadmate-control-center-488122614cc873bbea777853a48ae20e83ee18af.tar.bz2
mate-control-center-488122614cc873bbea777853a48ae20e83ee18af.tar.xz
gtk3: fix display properties dialog rendering
Diffstat (limited to 'capplets/display/scrollarea.c')
-rw-r--r--capplets/display/scrollarea.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/capplets/display/scrollarea.c b/capplets/display/scrollarea.c
index 5dfd2e7f..a160f532 100644
--- a/capplets/display/scrollarea.c
+++ b/capplets/display/scrollarea.c
@@ -325,9 +325,14 @@ foo_scroll_area_class_init (FooScrollAreaClass *class)
paint),
NULL, NULL,
foo_marshal_VOID__POINTER_BOXED_POINTER,
- G_TYPE_NONE, 3,
+ G_TYPE_NONE,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ 1,
+#else
+ 3,
G_TYPE_POINTER,
GDK_TYPE_RECTANGLE,
+#endif
G_TYPE_POINTER);
#if !GTK_CHECK_VERSION (3, 0, 0)
@@ -620,15 +625,15 @@ simple_draw_drawable (GdkDrawable *dst,
static gboolean
#if GTK_CHECK_VERSION (3, 0, 0)
foo_scroll_area_draw (GtkWidget *widget,
- cairo_t *cr)
+ cairo_t *widget_cr)
#else
foo_scroll_area_expose (GtkWidget *widget,
GdkEventExpose *expose)
#endif
{
FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
-#if !GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr;
+#if !GTK_CHECK_VERSION (3, 0, 0)
GdkGC *gc;
GdkRectangle extents;
GdkWindow *window = gtk_widget_get_window (widget);
@@ -661,7 +666,7 @@ foo_scroll_area_expose (GtkWidget *widget,
/* Setup input areas */
clear_exposed_input_region (scroll_area, scroll_area->priv->update_region);
-
+
scroll_area->priv->current_input = g_new0 (InputRegion, 1);
scroll_area->priv->current_input->region = gdk_region_copy (scroll_area->priv->update_region);
scroll_area->priv->current_input->paths = NULL;
@@ -676,6 +681,8 @@ foo_scroll_area_expose (GtkWidget *widget,
cr = gdk_cairo_create (scroll_area->priv->pixmap);
translate_cairo_device (cr, -x_offset, -y_offset);
clip_to_region (cr, region);
+#else
+ cr = cairo_create (scroll_area->priv->surface);
#endif
initialize_background (widget, cr);
@@ -690,10 +697,8 @@ foo_scroll_area_expose (GtkWidget *widget,
g_signal_emit (widget, signals[PAINT], 0, cr, &extents, region);
#endif
-#if !GTK_CHECK_VERSION (3, 0, 0)
/* Destroy stuff */
cairo_destroy (cr);
-#endif
#if !GTK_CHECK_VERSION (3, 0, 0)
scroll_area->priv->expose_region = NULL;
@@ -702,8 +707,8 @@ foo_scroll_area_expose (GtkWidget *widget,
/* Finally draw the backing pixmap */
#if GTK_CHECK_VERSION (3, 0, 0)
- cairo_set_source_surface (cr, scroll_area->priv->surface, widget_allocation.x, widget_allocation.y);
- cairo_paint (cr);
+ cairo_set_source_surface (widget_cr, scroll_area->priv->surface, widget_allocation.x, widget_allocation.y);
+ cairo_paint (widget_cr);
#else
gc = gdk_gc_new (window);