diff --git a/0001-scheduler-ipp.c-Convert-incoming-ColorModel-attribut.patch b/0001-scheduler-ipp.c-Convert-incoming-ColorModel-attribut.patch new file mode 100644 index 0000000..1bfb342 --- /dev/null +++ b/0001-scheduler-ipp.c-Convert-incoming-ColorModel-attribut.patch @@ -0,0 +1,43 @@ +From c114e3c9827af77e4574ec92f46ed4688b0a3059 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Tue, 2 Aug 2022 10:38:21 +0200 +Subject: [PATCH] scheduler/ipp.c: Convert incoming ColorModel attribute + +If a client uses PPD option ColorModel (which is converted into +attribute to be sent via IPP) for changing the default color option +(which happens via CUPS-Add-Modify-Printer operation), we have to +convert ColorModel into print-color-mode attribute, so the +print-color-mode-default attribute gets updated. + +The change survives reboot because print-color-mode is saved as an +option in printer's entry in /etc/cups/printers.conf. +--- + scheduler/ipp.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/scheduler/ipp.c b/scheduler/ipp.c +index b722712f6..fc575639b 100644 +--- a/scheduler/ipp.c ++++ b/scheduler/ipp.c +@@ -2340,6 +2340,18 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ + + set_device_uri = 0; + ++ if ((attr = ippFindAttribute(con->request, "ColorModel", IPP_TAG_NAME)) != NULL) ++ { ++ const char * keyword = NULL; ++ ++ if (!strcmp(attr->values[0].string.text, "FastGray") || !strcmp(attr->values[0].string.text, "Gray") || !strcmp(attr->values[0].string.text, "DeviceGray")) ++ keyword = "monochrome"; ++ else ++ keyword = "color"; ++ ++ printer->num_options = cupsAddOption("print-color-mode", keyword, printer->num_options, &printer->options); ++ } ++ + if ((attr = ippFindAttribute(con->request, "device-uri", + IPP_TAG_URI)) != NULL) + { +-- +2.39.2 + diff --git a/cups.spec b/cups.spec index e9cd89e..fb1bd32 100644 --- a/cups.spec +++ b/cups.spec @@ -74,6 +74,7 @@ Patch1001: 0001-scheduler-ipp.c-Allocate-device_uri-via-cupsdSetStri.patch Patch1002: cups-resolve-local.patch Patch1003: cups-ippeveprinter-typo.patch Patch1004: 0001-Don-t-override-color-settings-from-print-dialog.patch +Patch1005: 0001-scheduler-ipp.c-Convert-incoming-ColorModel-attribut.patch ##### Patches removed because IMHO they aren't no longer needed ##### but still I'll leave them in git in case their removal @@ -290,7 +291,10 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in %patch1002 -p1 -b .localhost # https://github.com/OpenPrinting/cups/pull/629 %patch1003 -p1 -b .ippeveprinter-typo +# https://github.com/OpenPrinting/cups/pull/417 %patch1004 -p1 -b .no_color_override +# https://github.com/OpenPrinting/cups/pull/451 +%patch1005 -p1 -b .save-color-settings %if %{lspp} @@ -700,6 +704,7 @@ rm -f %{cups_serverbin}/backend/smb * Thu Mar 02 2023 Zdenek Dohnal - 1:2.4.2-10 - fix loading ippeveps in ippeveprinter if only the command name is provided - don't override color settings from print dialog +- save the color settings between restarts * Mon Feb 20 2023 Zdenek Dohnal - 1:2.4.2-9 - move /etc/cups into cups-filesystem, since cups-browsed needs it