emacs-diffs
[Top][All Lists]
Advanced

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

master 2469e03603: Disable nearest-color allocation on DirectColor visua


From: Po Lu
Subject: master 2469e03603: Disable nearest-color allocation on DirectColor visuals
Date: Thu, 10 Feb 2022 20:27:31 -0500 (EST)

branch: master
commit 2469e036035f8f5baa78e1557c61df019d8fd572
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Disable nearest-color allocation on DirectColor visuals
    
    * src/xterm.c (x_alloc_nearest_color_1): Disable such allocation
    on DirectColor.  The method we use can't possibly work there.
---
 src/xterm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 095ed316cf..66666229cd 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3193,9 +3193,15 @@ x_parse_color (struct frame *f, const char *color_name,
 static bool
 x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
 {
+  struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
   bool rc;
 
+  eassume (dpyinfo);
   rc = XAllocColor (dpy, cmap, color) != 0;
+
+  if (dpyinfo->visual->class == DirectColor)
+    return rc;
+
   if (rc == 0)
     {
       /* If we got to this point, the colormap is full, so we're going



reply via email to

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