From c4c4fed16fd80654d40b356700076a27e49fc227 Mon Sep 17 00:00:00 2001 From: Monsta Date: Fri, 19 Jun 2015 15:22:02 +0300 Subject: [GTK+3] eel: fix bad positioning of rename window in certain cases adapted from https://github.com/linuxmint/nemo/commit/d5377cfd53034b6ab5588376322126f48782ec59 (thanks to @mtwebster and nautilus developer who did the original commit) fixes https://github.com/mate-desktop/caja/issues/376 --- eel/eel-canvas.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'eel') diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c index 602986c8..f0245f7a 100644 --- a/eel/eel-canvas.c +++ b/eel/eel-canvas.c @@ -3109,11 +3109,19 @@ eel_canvas_expose (GtkWidget *widget, GdkEventExpose *event) return FALSE; bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); + + if (!gtk_cairo_should_draw_window (cr, bin_window)) + return FALSE; + + cairo_save (cr); + gtk_cairo_transform_to_window (cr, widget, bin_window); region = eel_cairo_get_clip_region (cr); - if (region == NULL) + if (region == NULL) { + cairo_restore (cr); return FALSE; + } #else if (!gtk_widget_is_drawable (widget) || (event->window != gtk_layout_get_bin_window (&canvas->layout))) return FALSE; #endif @@ -3164,14 +3172,17 @@ eel_canvas_expose (GtkWidget *widget, GdkEventExpose *event) #endif /* Chain up to get exposes on child widgets */ -#if !GTK_CHECK_VERSION(3,0,0) - GTK_WIDGET_CLASS (canvas_parent_class)->expose_event (widget, event); -#else +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore (cr); + if (GTK_WIDGET_CLASS (canvas_parent_class)->draw) GTK_WIDGET_CLASS (canvas_parent_class)->draw (widget, cr); cairo_region_destroy (region); +#else + GTK_WIDGET_CLASS (canvas_parent_class)->expose_event (widget, event); #endif + return FALSE; } -- cgit v1.2.1