102.11.0-1
[arch-packages.git] / cups / trunk / 0002_do_not_set_RGB_default_on_monochrome_printers.patch
blob2b10c1f81ed343090cd392cd4ac0c3578d94589c
1 From ebf3bb82593e5f49093ed7b9e52452333240d225 Mon Sep 17 00:00:00 2001
2 From: Till Kamppeter <till.kamppeter@gmail.com>
3 Date: Wed, 15 Feb 2023 22:01:05 +0100
4 Subject: [PATCH] In auto-generated PPDs do not set RGB default on mono
5 printers
7 When a PPD for a driverless printer is generated by the
8 _ppdCreateFromIPP2() function and the get-printer-attributes IPP
9 response gives "print-color-mode-default=auto" the PPD's default
10 setting for "ColorModel" is always "RGB", even on monochrome printers,
11 which makes printing fail on most devices.
13 Now we ignore the "print-color-mode-default" if set to "auto" and
14 proceed as if no default was given, finding the default by selecting
15 the most desirable of the existing "ColorModel" choices.
16 ---
17 cups/ppd-cache.c | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
20 diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
21 index 3c53f510d..2489ee313 100644
22 --- a/cups/ppd-cache.c
23 +++ b/cups/ppd-cache.c
24 @@ -4129,7 +4129,8 @@ _ppdCreateFromIPP2(
25 int wrote_color = 0;
26 const char *default_color = NULL; /* Default */
28 - if ((keyword = ippGetString(defattr, 0, NULL)) != NULL)
29 + if ((keyword = ippGetString(defattr, 0, NULL)) != NULL &&
30 + strcmp(keyword, "auto"))
32 if (!strcmp(keyword, "bi-level"))
33 default_color = "FastGray";