diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-23 10:52:30 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-23 10:52:30 +0200 |
commit | a24f710395f9777cb9f8b000300e5e9c892d7794 (patch) | |
tree | 444ec08211a8ca446e6cce20d51c6bdb8d940074 /src/gtkutil.c | |
parent | 09e433ec7f8b2c25d5be2cdb5aac5e089a6e4cea (diff) | |
download | emacs-a24f710395f9777cb9f8b000300e5e9c892d7794.tar.gz emacs-a24f710395f9777cb9f8b000300e5e9c892d7794.tar.bz2 emacs-a24f710395f9777cb9f8b000300e5e9c892d7794.zip |
Don't use the Gtk region face
* lisp/faces.el (region): Don't use the Gtk region face, because
it produces low contrast combinations (bug#46493).
* src/gtkutil.h:
* src/gtkutil.c (xg_check_special_colors): Remove.
* src/xfns.c (x_defined_color):
* src/pgtkterm.c (pgtk_defined_color): Don't call.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index a6bba096a43..87f166bf54d 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -727,88 +727,6 @@ get_utf8_string (const char *str) return utf8_str; } -/* Check for special colors used in face spec for region face. - The colors are fetched from the Gtk+ theme. - Return true if color was found, false if not. */ - -bool -xg_check_special_colors (struct frame *f, - const char *color_name, - Emacs_Color *color) -{ - bool success_p; - bool get_bg; - bool get_fg; -#ifdef HAVE_GTK3 - GtkStyleContext *gsty; - GdkRGBA col; - char buf[sizeof "rgb://rrrr/gggg/bbbb"]; - int state; - GdkRGBA *c; - unsigned short r, g, b; -#else - GtkStyle *gsty; - GdkColor *grgb; -#endif - - get_bg = !strcmp ("gtk_selection_bg_color", color_name); - get_fg = !get_bg && !strcmp ("gtk_selection_fg_color", color_name); - success_p = false; - -#ifdef HAVE_PGTK - while (FRAME_PARENT_FRAME (f)) - f = FRAME_PARENT_FRAME (f); -#endif - - if (!FRAME_GTK_WIDGET (f) || !(get_bg || get_fg)) - return success_p; - - block_input (); -#ifdef HAVE_GTK3 - gsty = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f)); - state = GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED; - - if (get_fg) - gtk_style_context_get_color (gsty, state, &col); - else - { - /* FIXME: Retrieving the background color is deprecated in - GTK+ 3.16. New versions of GTK+ don't use the concept of a - single background color any more, so we shouldn't query for - it. */ - gtk_style_context_get (gsty, state, - GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c, - NULL); - col = *c; - gdk_rgba_free (c); - } - - r = col.red * 65535; - g = col.green * 65535; - b = col.blue * 65535; -#ifndef HAVE_PGTK - sprintf (buf, "rgb:%04x/%04x/%04x", r, g, b); - success_p = x_parse_color (f, buf, color) != 0; -#else - sprintf (buf, "#%04x%04x%04x", r, g, b); - success_p = pgtk_parse_color (f, buf, color) != 0; -#endif -#else - gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f)); - grgb = (get_bg ? &gsty->bg[GTK_STATE_SELECTED] - : &gsty->fg[GTK_STATE_SELECTED]); - - color->red = grgb->red; - color->green = grgb->green; - color->blue = grgb->blue; - color->pixel = grgb->pixel; - success_p = 1; -#endif - unblock_input (); - return success_p; -} - - /*********************************************************************** Tooltips |