Bug 749270

Summary: Default media size not set correctly
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: gnome-settings-daemonAssignee: Marek Kašík <mkasik>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: bnocera, mclasen, mkasik, rstrode
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gnome-settings-daemon-3.4.1-1.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-15 14:47:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 749235    
Bug Blocks:    

Description Tim Waugh 2011-10-26 15:34:28 UTC
Description of problem:
When a printer is added, the code that sets the page size is not quite right.  It adds a printer option default for "PageSize".  This has no effect on the PPD for the queue, so applications may get conflicting information about what the right default size is for the printer.

The correct way to do it is to set the "media" setting to either iso_a4 or na_letter, using the method described in bug #749235.  However, that isn't possible due to a limitation of cups-pk-helper.

The next best thing is to do it the way system-config-printer currently does it:
1. after adding the printer, fetch the PPD
2. mark the correct PageSize default, if it can be found ("A4" or "Letter")
3. perform a CUPS-Add-Printer request, providing the new PPD file

Version-Release number of selected component (if applicable):
gnome-settings-daemon-3.2.1-1.fc16.x86_64

Comment 1 Matthias Clasen 2011-11-14 23:26:36 UTC
I don't think we should be adding workarounds like that.
If we need a new method in cups-pk-helper, lets just add one there.

Comment 2 Tim Waugh 2011-11-15 10:17:59 UTC
OK, marking this as blocked by bug #749235.

Comment 3 Marek Kašík 2011-11-15 16:51:55 UTC
I agree with Matthias, I'll suggest the new method to upstream.

Comment 4 Marek Kašík 2011-11-22 14:14:26 UTC
Hi Tim,

I've implemented the method you talk about in #749235 but when I want to set 'media' to 'iso_a4' it doesn't work. I have to set 'media-default' to see the change in 'lpoptions' (shown in 'media' btw). It also works with the method PrinterAddOptionDefault() when setting 'media'.
Also, shouldn't we set 'iso-a4' here for A4 instead of 'iso_a4'?

Regards

Marek

Comment 5 Tim Waugh 2012-01-13 17:21:59 UTC
The correct attribute name is "media", not "media-default".  Setting media-default will add a server-side option in printers.conf, but will *not* adjust the PPD.

You're right about iso-a4 though, sorry about that.

# lpadmin -p Charlie -o media=na-letter
# systemctl restart cups.service # be sure that changes are written to the files
# grep media /etc/cups/printers.conf
# grep \*DefaultPageSize /etc/cups/ppd/Charlie.ppd
*DefaultPageSize: Letter
# lpoptions -p Charlie -l | grep PageSize | grep -o '\*[^ ]*'
*Letter

# lpadmin -p Charlie -o media=iso-a4
# systemctl restart cups.service # be sure that changes are written to the files
# grep media /etc/cups/printers.conf
# grep \*DefaultPageSize /etc/cups/ppd/Charlie.ppd
*DefaultPageSize: A4
# lpoptions -p Charlie -l | grep PageSize | grep -o '\*[^ ]*'
*A4

Comment 6 Marek Kašík 2012-05-15 14:47:38 UTC
This has been fixed in gnome-settings-daemon-3.4.1-1.fc17. I don't plan to backport the change into Fedora 16.

Regards

Marek