]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable unsuitable XPM color selection mechanism on Android
authorPo Lu <luangruo@yahoo.com>
Wed, 24 Apr 2024 08:33:33 +0000 (16:33 +0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 24 Apr 2024 17:44:10 +0000 (19:44 +0200)
* src/image.c (xpm_load_image) [HAVE_ANDROID]: Always select
XPM_COLOR_KEY_C.

(cherry picked from commit 3776539152711ca364d94f0d4f8166d6f67eb413)

src/image.c

index 74249b8d4653ae203c8a101f6fa052464f25c6dd..ab61e49f69569dfa3c3ac30d81f9208c9ce51298 100644 (file)
@@ -6237,6 +6237,8 @@ xpm_load_image (struct frame *f,
   expect (',');
 
   XSETFRAME (frame, f);
+
+#ifndef HAVE_ANDROID
   if (!NILP (Fxw_display_color_p (frame)))
     best_key = XPM_COLOR_KEY_C;
   else if (!NILP (Fx_display_grayscale_p (frame)))
@@ -6244,6 +6246,14 @@ xpm_load_image (struct frame *f,
                ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4);
   else
     best_key = XPM_COLOR_KEY_M;
+#else /* HAVE_ANDROID */
+  /* The color-loading loop has not been taught to progressively settle
+     for less optimal color keys if no colors are defined for best_key,
+     and since libXpm is not available on Android, there is no better
+     option than delegating the task of mapping whatever color values
+     are provided to B/W or grayscale to the display driver.  */
+  best_key = XPM_COLOR_KEY_C;
+#endif /* !HAVE_ANDROID */
 
   color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL);
   if (chars_per_pixel == 1)