From 982ec0398cea6e41bcfc022c333b6f695fc03241 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 27 Aug 2017 13:19:26 +0200 Subject: [PATCH] =?utf8?q?*=20src/xterm.c=20(XTflash):=20Don=E2=80=99t=20u?= =?utf8?q?se=20gdk=5Fcairo=5Fcreate=20in=20GDK=203.22+?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/xterm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index fb220b335a4..d9a6df75d97 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4018,7 +4018,13 @@ XTflash (struct frame *f) when the scroll bars and the edit widget share the same X window. */ GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); #ifdef HAVE_GTK3 +#if GTK_CHECK_VERSION (3, 22, 0) + cairo_region_t *region = gdk_window_get_visible_region (window); + GdkDrawingContext *context = gdk_window_begin_draw_frame (window, region); + cairo_t *cr = gdk_drawing_context_get_cairo_context (context); +#else cairo_t *cr = gdk_cairo_create (window); +#endif cairo_set_source_rgb (cr, 1, 1, 1); cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE); #define XFillRectangle(d, win, gc, x, y, w, h) \ @@ -4132,7 +4138,12 @@ XTflash (struct frame *f) #ifdef USE_GTK #ifdef HAVE_GTK3 +#if GTK_CHECK_VERSION (3, 22, 0) + gdk_window_end_draw_frame (window, context); + cairo_region_destroy (region); +#else cairo_destroy (cr); +#endif #else g_object_unref (G_OBJECT (gc)); #endif -- 2.39.2