aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Stephani2017-08-27 12:31:37 +0200
committerPhilipp Stephani2017-09-23 12:51:24 +0200
commitf6818e761eaafe095e07249180dc8f9a329f1473 (patch)
tree3464b3fbd6fda5337d014370d5abf61d730b28bd
parentf02e76fb8f8a862e43795056d61df5641c8a669b (diff)
downloademacs-f6818e761eaafe095e07249180dc8f9a329f1473.tar.gz
emacs-f6818e761eaafe095e07249180dc8f9a329f1473.zip
GTK+: Stop querying for background colors.
* src/gtkutil.c (xg_check_special_colors): Don't call deprecated function gtk_style_context_get_background_color in newer versions of GTK+.
-rw-r--r--src/gtkutil.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index f3e89c82c66..b98b0d08e7a 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -566,6 +566,14 @@ xg_check_special_colors (struct frame *f,
566 if (! FRAME_GTK_WIDGET (f) || ! (get_bg || get_fg)) 566 if (! FRAME_GTK_WIDGET (f) || ! (get_bg || get_fg))
567 return success_p; 567 return success_p;
568 568
569#if GTK_CHECK_VERSION (3, 16, 0)
570 if (get_bg)
571 /* gtk_style_context_get_background_color is deprecated in
572 GTK+ 3.16. New versions of GTK+ don't use the concept of a
573 single background color any more, so we can't query for it. */
574 return false;
575#endif
576
569 block_input (); 577 block_input ();
570 { 578 {
571#ifdef HAVE_GTK3 579#ifdef HAVE_GTK3
@@ -577,7 +585,12 @@ xg_check_special_colors (struct frame *f,
577 if (get_fg) 585 if (get_fg)
578 gtk_style_context_get_color (gsty, state, &col); 586 gtk_style_context_get_color (gsty, state, &col);
579 else 587 else
588#if GTK_CHECK_VERSION (3, 16, 0)
589 /* We can't get here. */
590 emacs_abort ();
591#else
580 gtk_style_context_get_background_color (gsty, state, &col); 592 gtk_style_context_get_background_color (gsty, state, &col);
593#endif
581 594
582 unsigned short 595 unsigned short
583 r = col.red * 65535, 596 r = col.red * 65535,