From: Philipp Stephani Date: Sun, 27 Aug 2017 11:19:26 +0000 (+0200) Subject: * src/xterm.c (XTflash): Don’t use gdk_cairo_create in GDK 3.22+ X-Git-Tag: emacs-26.0.90~339 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=982ec0398cea6e41bcfc022c333b6f695fc03241;p=emacs.git * src/xterm.c (XTflash): Don’t use gdk_cairo_create in GDK 3.22+ --- 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