summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-06-19 15:22:02 +0300
committerMonsta <[email protected]>2015-06-19 15:22:02 +0300
commitc4c4fed16fd80654d40b356700076a27e49fc227 (patch)
treeec040552d8cd5954144c0997db4fe52cb26a862f /eel
parent77ebf88b678149862def827a7e5d134e9df13122 (diff)
downloadcaja-c4c4fed16fd80654d40b356700076a27e49fc227.tar.bz2
caja-c4c4fed16fd80654d40b356700076a27e49fc227.tar.xz
[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
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-canvas.c19
1 files changed, 15 insertions, 4 deletions
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;
}