From: Jan Djärv Date: Sat, 9 Nov 2013 11:19:53 +0000 (+0100) Subject: * gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi: X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~880 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b24ac90f5d01e4999b9571ce3a51e8797859c193;p=emacs.git * gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi: for conversion. Fixes: debbugs:15837 --- diff --git a/src/ChangeLog b/src/ChangeLog index 587b97ecd1f..5ff279a4400 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-11-09 Łukasz Stelmach (tiny change) + + * gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi: + for conversion (Bug#15837). + 2013-11-09 Eli Zaretskii * fileio.c (Finsert_file_contents): Invalidate the newline cache diff --git a/src/gtkutil.c b/src/gtkutil.c index 9edcc2a6ef4..192b64a7e62 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -598,14 +598,17 @@ xg_check_special_colors (struct frame *f, GtkStyleContext *gsty = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f)); GdkRGBA col; - char buf[sizeof "rgbi://" + 3 * (DBL_MAX_10_EXP + sizeof "-1.000000" - 1)]; + char buf[sizeof "rgb://rrrr/gggg/bbbb"]; int state = GTK_STATE_FLAG_SELECTED|GTK_STATE_FLAG_FOCUSED; if (get_fg) gtk_style_context_get_color (gsty, state, &col); else gtk_style_context_get_background_color (gsty, state, &col); - sprintf (buf, "rgbi:%lf/%lf/%lf", col.red, col.green, col.blue); + sprintf (buf, "rgb:%04x/%04x/%04x", + (int)(col.red * 65535), + (int)(col.green * 65535), + (int)(col.blue * 65535)); success_p = (XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), buf, color) != 0);