After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660769 - Handle other paper sizes
Handle other paper sizes
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: printers
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
gnome-settings-daemon-maint
3.10
Depends on:
Blocks:
 
 
Reported: 2011-10-03 10:25 UTC by Bastien Nocera
Modified: 2019-03-20 10:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
print-notifications: Fix setting of page size (2.87 KB, patch)
2015-07-24 11:36 UTC, Marek Kašík
committed Details | Review
Don't set unsupported paper size (5.54 KB, patch)
2015-07-24 11:39 UTC, Marek Kašík
none Details | Review
Don't set unsupported paper size (5.74 KB, patch)
2015-07-27 09:44 UTC, Marek Kašík
none Details | Review

Description Bastien Nocera 2011-10-03 10:25:22 UTC
We currently only handle A4 and Letter as papersizes, we should also handle others like B5 (popular in Japan), and the ones listed in:
http://git.gnome.org/browse/gtk+/tree/gtk/gtkpapersize.h

A4 and letter are going to be absolutely useless for a photo printer for example.
Comment 1 Marek Kašík 2015-07-24 11:36:50 UTC
Created attachment 308074 [details] [review]
print-notifications: Fix setting of page size

This patch sets PPD's 'PageSize' attribute instead of IPP's 'media' attribute. We've changed this in gnome-control-center too since setting 'PageSize' is safer choice when setting default paper size.
Comment 2 Marek Kašík 2015-07-24 11:39:15 UTC
Created attachment 308075 [details] [review]
Don't set unsupported paper size

This patch fixes the reported problem by checking whether the paper size selected according to locale is present among paper sizes listed in the printer's PPD file.
If it is not there then it keeps what the PPD has as its default.
Comment 3 Bastien Nocera 2015-07-24 12:11:38 UTC
Review of attachment 308074 [details] [review]:

Sure.
Comment 4 Bastien Nocera 2015-07-24 15:30:14 UTC
Review of attachment 308075 [details] [review]:

::: plugins/print-notifications/gsd-printer.c
@@ +771,2 @@
+                        if (ppd_size != NULL)
+                          size_is_present = TRUE;

indentation.

@@ +778,2 @@
+        if (size_is_present) {
+                proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,

Any chance to replace this by an async call? You'd be blocking the whole of gnome-settings-daemon with that.

@@ +789,1 @@
                         g_warning ("%s", error->message);

if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
   g_warning()...

@@ +809,3 @@
+                        g_variant_unref (output);
+                } else {
+                        if (!(error->domain == G_DBUS_ERROR &&

g_error_matches()
Comment 5 Marek Kašík 2015-07-27 09:44:35 UTC
Created attachment 308203 [details] [review]
Don't set unsupported paper size

(In reply to Bastien Nocera from comment #4)
> Review of attachment 308075 [details] [review] [review]:
> 
> ::: plugins/print-notifications/gsd-printer.c
> @@ +771,2 @@
> +                        if (ppd_size != NULL)
> +                          size_is_present = TRUE;
> 
> indentation.

Fixed.


> @@ +778,2 @@
> +        if (size_is_present) {
> +                proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
> 
> Any chance to replace this by an async call? You'd be blocking the whole of
> gnome-settings-daemon with that.

Actually, it doesn't block gnome-settings-daemon. 'gsd-printer' is a binary which is executed asynchronously from gnome-settings-daemon and implements com.redhat.NewPrinterNotification and com.redhat.PrinterDriversInstaller DBus interfaces.


> @@ +789,1 @@
>                          g_warning ("%s", error->message);
> 
> if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
>    g_warning()...

Added.


> @@ +809,3 @@
> +                        g_variant_unref (output);
> +                } else {
> +                        if (!(error->domain == G_DBUS_ERROR &&
> 
> g_error_matches()

Changed.
Comment 6 GNOME Infrastructure Team 2019-03-20 10:56:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/177.