Backport fix from GTK+3: Allow the lpr backend to print PDF and PS files.

ok ajacoutot@
This commit is contained in:
naddy 2020-12-07 20:21:32 +00:00
parent 8b9c8cf3b3
commit dff345950c
2 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.236 2020/11/11 11:49:55 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.237 2020/12/07 20:21:32 naddy Exp $
DPB_PROPERTIES= parallel
@ -11,7 +11,7 @@ GNOME_PROJECT= gtk+
PKGNAME-main= gtk+2-${GNOME_VERSION}
PKGNAME-cups= gtk+2-cups-${GNOME_VERSION}
REVISION-main= 10
REVISION-main= 11
REVISION-cups= 4
CATEGORIES= x11 devel

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-modules_printbackends_lpr_gtkprintbackendlpr_c,v 1.3 2020/12/07 20:21:32 naddy Exp $
Allow attempts to print PDF and PS files using the LPR backend.
https://gitlab.gnome.org/GNOME/gtk/-/commit/8d5357ee56b1d34fe14346ed15004f9e4d571594
Index: modules/printbackends/lpr/gtkprintbackendlpr.c
--- modules/printbackends/lpr/gtkprintbackendlpr.c.orig
+++ modules/printbackends/lpr/gtkprintbackendlpr.c
@@ -392,9 +392,13 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backen
{
GtkPrinter *printer;
- printer = gtk_printer_new (_("Print to LPR"),
- GTK_PRINT_BACKEND (backend),
- TRUE);
+ printer = g_object_new (GTK_TYPE_PRINTER,
+ "name", _("Print to LPR"),
+ "backend", backend,
+ "is-virtual", FALSE,
+ "accepts-pdf", TRUE,
+ "accepts-ps", TRUE,
+ NULL);
gtk_printer_set_has_details (printer, TRUE);
gtk_printer_set_icon_name (printer, "gtk-print");
gtk_printer_set_is_active (printer, TRUE);