In comment nos. 25 and 27 of that report Benjamin Berg describes this "Custom." prefix problem and a patch to remove it when the GTK+ print dialog. Commit 8170436e61ea68 was found to cause a crash in Thunderbird and Inkscape, and was subsequently revised by commit 9afe13bf91.
commit 9afe13bf91d8e80c4def7d3944d56542ce13733f
Author: Marek Kasik <email address hidden>
Date: Tue Jan 31 12:15:43 2012 +0100
printing: Don't crash when printing
This commit fixes crash which occurs in Firefox, Thunderbird and Inkscape
during printing. This crash was caused because of wrong handling of Custom
CUPS options. (#543520)
These commits are included in Ubuntu's 3.4.2 release.
My suspicion is that this code in create_pickone_option () {
...
if (option->type != GTK_PRINTER_OPTION_TYPE_PICKONE)
{
if (g_str_has_prefix (ppd_option->defchoice, "Custom.")) gtk_printer_option_set (option, ppd_option->defchoice + 7);
else gtk_printer_option_set (option, ppd_option->defchoice);
}
else
...
}
isn't being executed in some circumstances, leading to the "Custom." prefix received from CUPS then being further prefixed by add_cups_options() when the ->print_stream op is called.
In modules/ printbackends/ cups/gtkprintba ckendcups. c:
static void cups_request_ encode_ option (request, key, new_value); cups_request_ encode_ option (request, key, value);
add_cups_options (const gchar *key,
const gchar *value,
gpointer user_data)
{
...
/* Add "Custom." prefix to custom values. */
if (custom_value)
{
new_value = g_strdup_printf ("Custom.%s", value);
gtk_
g_free (new_value);
}
else
gtk_
}
This is called from:
static void gtk_print_ backend_ cups_print_ stream (...) { settings_ foreach (settings, add_cups_options, options_data);
...
gtk_print_
...
}
which is called via the ops pointer print_stream:
backend_ class-> print_stream = gtk_print_ backend_ cups_print_ stream;
The "Custom." code was added:
commit 8170436e61ea68c 713d75ad374d22c 3261be9203
Author: Benjamin Berg <email address hidden>
Date: Sat Dec 24 17:26:32 2011 +0100
Set cups Custom print options correctly (bug #543520, patch by Marek Kašík)
This patch fixes the cups print backend to pass Custom options with
the "Custom." prefix to cups if neccessary.
https:/ /bugzilla. gnome.org/ show_bug. cgi?id= 543520
In comment nos. 25 and 27 of that report Benjamin Berg describes this "Custom." prefix problem and a patch to remove it when the GTK+ print dialog. Commit 8170436e61ea68 was found to cause a crash in Thunderbird and Inkscape, and was subsequently revised by commit 9afe13bf91.
commit 9afe13bf91d8e80 c4def7d3944d565 42ce13733f
Author: Marek Kasik <email address hidden>
Date: Tue Jan 31 12:15:43 2012 +0100
printing: Don't crash when printing
This commit fixes crash which occurs in Firefox, Thunderbird and Inkscape
during printing. This crash was caused because of wrong handling of Custom
CUPS options. (#543520)
These commits are included in Ubuntu's 3.4.2 release.
My suspicion is that this code in create_ pickone_ option () { OPTION_ TYPE_PICKONE) >defchoice, "Custom."))
gtk_ printer_ option_ set (option, ppd_option- >defchoice + 7);
gtk_ printer_ option_ set (option, ppd_option- >defchoice) ;
...
if (option->type != GTK_PRINTER_
{
if (g_str_has_prefix (ppd_option-
else
}
else
...
}
isn't being executed in some circumstances, leading to the "Custom." prefix received from CUPS then being further prefixed by add_cups_options() when the ->print_stream op is called.