qt print dialog shipped with bionic ignores printer defaults

Bug #1776173 reported by Sergio Callegari
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
qtbase-opensource-src (Ubuntu)
Fix Released
Medium
Unassigned
Bionic
Fix Released
Medium
Unassigned
Cosmic
Fix Released
Medium
Unassigned

Bug Description

[Impact]
All kde applications shipped with ubuntu and particularly kubuntu bionic print via the qt print dialog, that, unfortunately, does not seem to respect the defaults set for the printer.

Specifically, every time one starts to print the "duplex" option gets reset to "none" even for those printers that were configured for "long edge" duplex by default.

This may lead to a huge *waste of paper*: people print, expecting the duplex, do not get it, throw away the printout and reprint, for a total of 3 times the paper usage if the print dialog respected the default.

[Test Case]
1) Install a printer that can duplex and configure it to do duplex with long-edge binding from the printer setup dialog.

2) Open a PDF with okular, and open the print dialog. Select the printer above.

3) Press the "Options" button to enlarge the dialog to also present the options. Select the "options" tab, right of "copies". Verify that Duplex Printing is preset to "None"

This is wrong, because the printer was configured to do duplex with long-edge binding.

4) Print and close okular.

5) Reopen okular (with the same or another PDF file). Open again the print dialog and select the same printer.

6) Redo 3). Again see that Duplex Printing is preset to "None", instead of being at the default or at the previously used setup.

[Regression Potential]
The proposed patch only changes the default settings. The regression potential may be that the values are wrong, although they are already wrong.

In case there is some bug it may lead to crashes. But this code is in the latest stable Qt release and I am not aware of any such crashes reported.

[Other Info]
The proposed patch is a backport of the following upstream commits:
- https://code.qt.io/cgit/qt/qtbase.git/commit/?id=f6fd3f18d301cde3
- https://code.qt.io/cgit/qt/qtbase.git/commit/?id=fa854f214a3c812e

[Original Description]
See also https://bugs.kde.org/show_bug.cgi?id=395150

As a final comment and in general, I think that Bionic should be updated to use the QT 5.11 print subsystem (from 5.9.5) as soon as possible (at least via a kubuntu ppa). The QT 5 print dialog has always been extremely poor, with no possibility to provide information about things like print quality and resolution, paper type, stapling (for printers supporting it), etc. Now, QT 5.11 has finally a better print dialog and it would be great if the bionic users could use it.

Revision history for this message
Sergio Callegari (callegar) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtbase-opensource-src (Ubuntu):
status: New → Confirmed
Revision history for this message
Jan Daciuk (jandac1) wrote :

I have just wasted 16 pages of paper.

Revision history for this message
Robert Bredereck (rbredereck) wrote :

It seems like a solution would be to backport the following patch:
https://codereview.qt-project.org/#/c/226881/

Revision history for this message
Robert Bredereck (rbredereck) wrote :

I've have now played around a bit and backported the patch mentioned in my last comment. It seems to work fine. You may want to test it installing "libqt5printsupport5" from my ppa: https://launchpad.net/~rbredereck/+archive/ubuntu/qtbase-opensource-src-duplexpatch

Revision history for this message
Robert Bredereck (rbredereck) wrote :

This patch is confirmed (by colleagues of my working group) to fix the bug.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "99-qtprintdialog-backport-duplex.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Mathias Reichardt (mathiasreichardt) wrote :

On my system there are more missing or broken options (not only the duplex problem) in the qt print dialog.

On my bionic system i found the following other problems:
- the printers are always on color mode, instead of gray-scale.
- the option to select the input tray is missing.
- the borders can't set smaller then the default.

it would be good if not only the duplex option would be fixed.

Revision history for this message
Sergio Callegari (callegar) wrote :

1) I confirm that the gray-scale printing option is completely ignored and that the printer prints always in color (this is definitively a bug).

2) I confirm that an option to select the printer tray is missing (though I think this may be a limitation in the qt version shipped with bionic).

3) I would like to add that okular "scales down" when printing A4 pdf documents, which badly breaks some flows. For instance, pages of the same document printed on the same printer with okular and any other linux PDF viewer do not align and cannot be mixed; flows needing accurate placement of cropmarks are broken (this is also a bug).

Probably these should be new bugs, though.

Still I wonder if moving to the current qt 5.9.7 from the bionic 5.9.5 could improve the situation. In the end qt 5.9 is a long term release with only bugfixes applied and it should be relatively safe to track it rather than introducing downstream patches.

Revision history for this message
Sergio Callegari (callegar) wrote :

The issue is also present in cosmic.
Wonder if someone might be kind enough to build a deb with the patch for cosmic too... Would be very much appreciated!

Revision history for this message
Robert Bredereck (rbredereck) wrote :

I would be willing to have a look and try to backport the patch I provided. However, at first I would like to have an explanation from the ubuntu maintainers why the few-lines-patch I provided, which enables easy duplex printing for many people (and so safe a lot of paper), has not been included.

Otherwise, I can only recommend to use a different distribution. There probably are some where maintainers can imagine that some users actually use their LTS distribution in a productive environment that want to print (duplex)...

(Btw, I fully agree that a patch that would resolve more of the issues would be very nice. However such patch would require huge changes in the code which certainly will never be accepted...Let us better at least hope to fix the most annoying issue.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.11.3+dfsg-5ubuntu1

---------------
qtbase-opensource-src (5.11.3+dfsg-5ubuntu1) disco; urgency=medium

  * Sync with experimental branch of Debian packaging Git.

 -- Dmitry Shachnev <email address hidden> Mon, 11 Feb 2019 13:43:15 +0300

Changed in qtbase-opensource-src (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Sergio Callegari (callegar) wrote :

Should a specific bug be opened to ask for this to be officially backported to Bionic+Cosmic as a bug-fix?

Revision history for this message
Robert Bredereck (rbredereck) wrote :

This is great news. Thanks a lot!

(According to Debian changelog, the patch provided here was indeed used in some variant. So being so annoying was not for nothing... Sorry for being offensive, but I really wanted to have to existing solution to be implemented. Next time I might directly go the Debian way.)

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Hi Robert and Sergio!

Sorry for the delay with fixing this. In Qt packaging team, we are all volunteers and work in our free time.

Initially I hoped that one of my co-maintainers would take care of this issue, but looks like they also didn’t have time, so I fixed it myself for the development release.

I will look at backporting this change to Bionic and Cosmic soon.

Note that I applied only Robert’s patch that fixes duplex printing. For Ubuntu 19.04 we are going to ship Qt 5.12, which should have much better printing experience. If there are other patches that can be backported, please let me know.

Also, if one of you adds a test case (steps to reproduce) for the duplex issue to the bug description, it will speed up the stable update a bit.

Revision history for this message
Sergio Callegari (callegar) wrote :

Hi Dmitry,

thanks for your message and the work as volunteers on Qt packaging.
My message was merely to know if there was any need for a specific bug item about the backporting and it is great to hear that you were already planning the backport!
Also, great to hear that 19.04 is going to get the Qt LTS.

Reproducing the duplex issue is very easy.

1) Install a printer that can duplex and configure it to do duplex with long-edge binding from the printer setup dialog.

2) Open a PDF with okular, and open the print dialog. Select the printer above.

3) Press the "Options" button to enlarge the dialog to also present the options. Select the "options" tab, right of "copies". Verify that Duplex Printing is preset to "None"

This is wrong, because the printer was configured to do duplex with long-edge binding.

4) Print and close okular.

5) Reopen okular (with the same or another PDF file). Open again the print dialog and select the same printer.

6) Redo 3). Again see that Duplex Printing is preset to "None", instead of being at the default or at the previously used setup.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Uploaded fix for Bionic, it is now waiting for approval in the queue: https://launchpad.net/ubuntu/bionic/+queue?queue_state=1

Will someone be able to test a Cosmic fix if I do it?

description: updated
Changed in qtbase-opensource-src (Ubuntu Cosmic):
status: New → Incomplete
Changed in qtbase-opensource-src (Ubuntu Bionic):
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Sergio Callegari (callegar) wrote :

Dimitri, if you can have a package for cosmic with the fix built in a PPA, I would be glad to try it.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

OK, I have just uploaded the fix for Cosmic too. If you want to test it before it is accepted into -proposed, it is also available here: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3634.

Changed in qtbase-opensource-src (Ubuntu Cosmic):
status: Incomplete → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Sergio, or anyone else affected,

Accepted qtbase-opensource-src into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/qtbase-opensource-src/5.11.1+dfsg-7ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in qtbase-opensource-src (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Changed in qtbase-opensource-src (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Sergio, or anyone else affected,

Accepted qtbase-opensource-src into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/qtbase-opensource-src/5.9.5+dfsg-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Mathew Hodson (mhodson)
Changed in qtbase-opensource-src (Ubuntu):
importance: Undecided → Medium
Changed in qtbase-opensource-src (Ubuntu Cosmic):
importance: Undecided → Medium
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Sergio, Robert: can you please test the packages in bionic-proposed and cosmic-proposed?

Revision history for this message
Robert Bredereck (rbredereck) wrote :

Thanks, I can test bionic-proposed.

Revision history for this message
Sergio Callegari (callegar) wrote :

Hi Dmitry,

I've been testing the package in cosmic-proposed in the last few days. Sorry I have not reported earlier, but I encountered a little problem and I wanted to look better at it for extra safety.

In fact, it was a problem with a single printer of the many I use while roaming with my laptop and got fixed by updating the printer driver. The QT packages are OK for me.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Revision history for this message
Robert Bredereck (rbredereck) wrote :

I can also confirm that the fix in bionic-proposed works for us.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks to you both for testing! Adjusting the tags accordingly.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.11.1+dfsg-7ubuntu3

---------------
qtbase-opensource-src (5.11.1+dfsg-7ubuntu3) cosmic; urgency=medium

  * Backport upstream commit to fix duplex printing (LP: #1776173).
    Thanks to Robert Bredereck for the initial patch!

 -- Dmitry Shachnev <email address hidden> Thu, 28 Feb 2019 13:26:39 +0300

Changed in qtbase-opensource-src (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for qtbase-opensource-src has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.9.5+dfsg-0ubuntu2

---------------
qtbase-opensource-src (5.9.5+dfsg-0ubuntu2) bionic; urgency=medium

  * Backport two upstream commits to fix duplex printing (LP: #1776173).
    Thanks to Robert Bredereck for the initial patch!

 -- Dmitry Shachnev <email address hidden> Wed, 06 Feb 2019 10:47:55 +0300

Changed in qtbase-opensource-src (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.