emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115051: * gtkutil.c (xg_check_special_colors): Use


From: Jan D.
Subject: [Emacs-diffs] trunk r115051: * gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi:
Date: Sat, 09 Nov 2013 11:19:57 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115051
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15837
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sat 2013-11-09 12:19:53 +0100
message:
  * gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi:
  for conversion.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/gtkutil.c                  gtkutil.c-20091113204419-o5vbwnq5f7feedwu-2527
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-11-09 11:12:33 +0000
+++ b/src/ChangeLog     2013-11-09 11:19:53 +0000
@@ -1,3 +1,8 @@
+2013-11-09  Ɓukasz Stelmach <address@hidden> (tiny change)
+
+       * gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi:
+       for conversion (Bug#15837).
+
 2013-11-09  Eli Zaretskii  <address@hidden>
 
        * fileio.c (Finsert_file_contents): Invalidate the newline cache

=== modified file 'src/gtkutil.c'
--- a/src/gtkutil.c     2013-10-29 16:08:08 +0000
+++ b/src/gtkutil.c     2013-11-09 11:19:53 +0000
@@ -598,14 +598,17 @@
     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);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]