GNOME Bugzilla – Bug 748569
Media Size can't be changed
Last modified: 2015-06-12 14:26:55 UTC
Originally filed as https://bugzilla.redhat.com/show_bug.cgi?id=1215909 Description of problem: Media Size defaults to Letter, when I try to change it, it snaps back to Letter. control-center-3.16.1-1.fc22.x86_64 Steps to Reproduce: 1. Add Epson Stylus Pro 3880 2. Click Options 3. Click Media Size > Letter and choose e.g. Super B 13x19 There's no error message in the GUI, which there probably should be if there is in fact some error preventing this. I can change Paper Type. The journal doesn't seem to contain anything useful, but I've included the most recent output at the time of the Media Size change attempt in the Fedora report.
Thank you for this report. The base problem here is that CUPS uses 2 systems for storing default settings and I've used one when configuring new printer (IPP - media) and the second one for the setting of paper in Options dialog (PPD - PageSize). The problem you see is result of this inconsistency. Another 'problem' is that when we are showing the combo for setting of paper size we open the printer's PPD, mark default options (probably from the PPD) and then mark options taken from the destination (printer). This shows us the IPP setting which we can not change in the dialog. Ideally we would set paper size in the both system but here is another 'problem'; paper sizes don't have the same names in those systems (e.g. 'na-letter' vs. 'Letter', 'iso-a4' vs. 'A4' and many many others). I have to think about this a little. But I will probably give higher priority to the PPD because we use it for creating the Options dialog (another thing is that handling of PPDs will be deprecated in CUPS...). This means that I will set 'PageSize' when creating printer instead of 'media' and maybe remove cupsMarkOptions() from PpPPOptionWidget's update function.
Basically we are reading setting from PPD and overriding it with a IPP version of the same in /etc/printers.conf or in lpoptions files if such exists for given setting in the PpPPDOptionWidget. The PpIPPOptionWidget shows just the IPP and lpoptions setting but we use it for limited set of options now (number-up, sides and orientation-requested). It then depends on the specific application (or its gui toolkit - gtk+) which option it will use for default value of the setting.
Created attachment 303803 [details] [review] Remove unused function
Created attachment 303804 [details] [review] Fix setting of page size This patch sets 'PageSize' instead of 'media' for new printers since we use PPD for construction of the combo for selecting of default paper size. It also removes marking of IPP and user's local options as default in PpPPDOptionWidget since it should use just PPD (we can change PPD values only in this widget). As I said before, ideal solution would be a joint IPP PPD widget which would set corresponding both IPP-PPD options but this would need a mapping between IPP and PPD options and their values (I'm trying to do something like this in gtk+ but it is not finished yet).
Review of attachment 303803 [details] [review]: Sure.
Review of attachment 303804 [details] [review]: The commit message doesn't explain things to me...
"Set 'PageSize' instead of 'media' for new printers since we use PPD for construction of the combo for selecting of default paper size." - Previously, we've been setting 'media' attribute for new printers. Attribute 'media' is used by IPP but we set paper size using 'PageSize' which comes from PPD in the options dialog. Sometimes (quite often) IPP gets priority over PPD in print systems. Therefore there was inconsistency of what user set as default paper size on the options dialog and what was used. Also don't mark IPP and user's local options as default in PpPPDOptionWidget since it should use just PPD (we can change PPD values only in this widget). - Since we use PPD for setting of paper size in the options dialog, we shouldn't show a value which user does not change actually (IPP's 'media' vs. PPD's 'PageSize'). Is it better?
Better indeed.
Created attachment 305149 [details] [review] Fix setting of page size
Review of attachment 305149 [details] [review]: Looks good.
Thank you for the reviews, I've pushed the patches to 3.16 and master branches.