diff options
author | drochner <drochner@pkgsrc.org> | 2012-02-01 18:23:04 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2012-02-01 18:23:04 +0000 |
commit | 627ed12a859169da78b44bc138f9a998d718d1b0 (patch) | |
tree | 6084aa7849e48675bc7e3bc72a19e87825975c55 /x11/gtk2/patches | |
parent | f2aae98aabe5c8d15f861777a927c086ed7abe76 (diff) | |
download | pkgsrc-627ed12a859169da78b44bc138f9a998d718d1b0.tar.gz |
replace the patch for the printing problem by the official upstream one,
bump PKGREV
Diffstat (limited to 'x11/gtk2/patches')
-rw-r--r-- | x11/gtk2/patches/patch-ak | 123 |
1 files changed, 76 insertions, 47 deletions
diff --git a/x11/gtk2/patches/patch-ak b/x11/gtk2/patches/patch-ak index 1485c85f947..2a8b84f7e48 100644 --- a/x11/gtk2/patches/patch-ak +++ b/x11/gtk2/patches/patch-ak @@ -1,62 +1,81 @@ -$NetBSD: patch-ak,v 1.5 2012/01/29 10:56:44 drochner Exp $ +$NetBSD: patch-ak,v 1.6 2012/02/01 18:23:05 drochner Exp $ -revert upstream commit 8170436e61ea68c713d75ad374d22c3261be9203, -it causes firefox crashes (see gnome bug #543520) +gnome bug #543520 --- modules/printbackends/cups/gtkprintbackendcups.c.orig 2012-01-24 19:38:37.000000000 +0000 +++ modules/printbackends/cups/gtkprintbackendcups.c -@@ -483,44 +483,22 @@ cups_print_cb (GtkPrintBackendCups *prin - GDK_THREADS_LEAVE (); - } +@@ -485,7 +485,7 @@ cups_print_cb (GtkPrintBackendCups *prin --typedef struct { -- GtkCupsRequest *request; + typedef struct { + GtkCupsRequest *request; - GtkPrinterOptionSet *options; --} CupsOptionsData; -- ++ GtkPrinterCups *printer; + } CupsOptionsData; + static void - add_cups_options (const gchar *key, - const gchar *value, - gpointer user_data) +@@ -495,9 +495,13 @@ add_cups_options (const gchar *key, { -- CupsOptionsData *data = (CupsOptionsData *) user_data; -- GtkCupsRequest *request = data->request; + CupsOptionsData *data = (CupsOptionsData *) user_data; + GtkCupsRequest *request = data->request; - GtkPrinterOptionSet *options = data->options; - GtkPrinterOption *option = NULL; -- gchar *new_value = NULL; -+ GtkCupsRequest *request = user_data; ++ GtkPrinterCups *printer = data->printer; ++ gboolean custom_value = FALSE; + gchar *new_value = NULL; ++ gint i; ++ ++ if (!key || !value) ++ return; if (!g_str_has_prefix (key, "cups-")) return; - +@@ -505,17 +509,37 @@ add_cups_options (const gchar *key, if (strcmp (value, "gtk-ignore-value") == 0) return; -- + - option = gtk_printer_option_set_lookup (options, key); - +- key = key + strlen ("cups-"); - /* Add "Custom." prefix to custom values */ - if (value && option && - !gtk_printer_option_has_choice (option, value)) - new_value = g_strdup_printf ("Custom.%s", value); -- -- if (new_value) -- { -- gtk_cups_request_encode_option (request, key, new_value); -- g_free (new_value); -- } -- else -- gtk_cups_request_encode_option (request, key, value); -+ gtk_cups_request_encode_option (request, key, value); - } ++ if (printer && printer->ppd_file) ++ { ++ ppd_coption_t *coption; ++ gboolean found = FALSE; ++ gboolean custom_values_enabled = FALSE; ++ ++ coption = ppdFindCustomOption (printer->ppd_file, key); ++ if (coption && coption->option) ++ { ++ for (i = 0; i < coption->option->num_choices; i++) ++ { ++ /* Are custom values enabled ? */ ++ if (g_str_equal (coption->option->choices[i].choice, "Custom")) ++ custom_values_enabled = TRUE; ++ ++ /* Is the value among available choices ? */ ++ if (g_str_equal (coption->option->choices[i].choice, value)) ++ found = TRUE; ++ } ++ ++ if (custom_values_enabled && !found) ++ custom_value = TRUE; ++ } ++ } - static void -@@ -533,12 +511,8 @@ gtk_print_backend_cups_print_stream (Gtk - { - GtkPrinterCups *cups_printer; - CupsPrintStreamData *ps; -- CupsOptionsData *options_data; +- if (new_value) ++ /* Add "Custom." prefix to custom values. */ ++ if (custom_value) + { ++ new_value = g_strdup_printf ("Custom.%s", value); + gtk_cups_request_encode_option (request, key, new_value); + g_free (new_value); + } +@@ -536,9 +560,6 @@ gtk_print_backend_cups_print_stream (Gtk + CupsOptionsData *options_data; GtkCupsRequest *request; GtkPrintSettings *settings; - GtkPrinterOptionSet *options; @@ -65,7 +84,7 @@ it causes firefox crashes (see gnome bug #543520) const gchar *title; char printer_absolute_uri[HTTP_MAX_URI]; -@@ -547,8 +521,6 @@ gtk_print_backend_cups_print_stream (Gtk +@@ -547,8 +568,6 @@ gtk_print_backend_cups_print_stream (Gtk cups_printer = GTK_PRINTER_CUPS (gtk_print_job_get_printer (job)); settings = gtk_print_job_get_settings (job); @@ -74,24 +93,34 @@ it causes firefox crashes (see gnome bug #543520) request = gtk_cups_request_new_with_username (NULL, GTK_CUPS_POST, -@@ -586,18 +558,8 @@ gtk_print_backend_cups_print_stream (Gtk +@@ -586,16 +605,10 @@ gtk_print_backend_cups_print_stream (Gtk IPP_TAG_NAME, "job-name", NULL, title); - options = cups_printer_get_options (GTK_PRINTER (cups_printer), settings, page_setup, capabilities); - -- options_data = g_new0 (CupsOptionsData, 1); -- options_data->request = request; + options_data = g_new0 (CupsOptionsData, 1); + options_data->request = request; - options_data->options = options; - -- gtk_print_settings_foreach (settings, add_cups_options, options_data); ++ options_data->printer = cups_printer; + gtk_print_settings_foreach (settings, add_cups_options, options_data); - - g_object_unref (page_setup); - g_object_unref (options); -- g_free (options_data); -- -+ gtk_print_settings_foreach (settings, add_cups_options, request); -+ + g_free (options_data); + ps = g_new0 (CupsPrintStreamData, 1); - ps->callback = callback; - ps->user_data = user_data; +@@ -4606,7 +4619,12 @@ cups_printer_get_default_page_size (GtkP + return NULL; + + option = ppdFindOption (ppd_file, "PageSize"); ++ if (option == NULL) ++ return NULL; ++ + size = ppdPageSize (ppd_file, option->defchoice); ++ if (size == NULL) ++ return NULL; + + return create_page_setup (ppd_file, size); + } |