Closed Bug 1620950 Opened 4 years ago Closed 4 years ago

Port Bug 1602561 to Thunderbird: Make PrintUtils.printWindow() act on a BrowsingContext.

Categories

(Thunderbird :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 76.0

People

(Reporter: mkmelin, Assigned: mkmelin)

References

Details

Attachments

(1 file)

Port Bug 1602561. Make PrintUtils.printWindow() act on a BrowsingContext.

https://hg.mozilla.org/mozilla-central/rev/c78f989b17befffd3009ce9fea4103a759bbbd71

Doesn't fix bug 1620314 but with this e.g. compose window can print.

Attachment #9131845 - Flags: review?(richard.marti)
Summary: Port Bug 1602561 to Thunderbord: Make PrintUtils.printWindow() act on a BrowsingContext. → Port Bug 1602561 to Thunderbird: Make PrintUtils.printWindow() act on a BrowsingContext.
Comment on attachment 9131845 [details] [diff] [review]
bug1620950_print_broken.patch

Review of attachment 9131845 [details] [diff] [review]:
-----------------------------------------------------------------

When the compose window is opened the first time, printing works but only through `Print Preview`. Directly through `Print...` or CTRL+P it doesn't work. I then also get, when trying again to print directly, this message: `Some printing functionality is not currently available.` Closing the composer and opening it again let me print.

::: mail/components/compose/content/ComposerCommands.js
@@ +2078,5 @@
>    doCommandParams(aCommand, aParams, aRefCon) {},
>  
>    doCommand(aCommand) {
> +    let browser = GetCurrentEditorElement();
> +    PrintUtils.printWindow(browser.browsingContext);

The try/catch here and on the other places are no more needed?
Attachment #9131845 - Flags: review?(richard.marti)

Hmm, it seems it's always working the only for the second time (second opened compose win), but both ways works for me.
I suspect the problems are part of bug 1620314.

I can't imagine the try/catches would be useful. They would only hide potential errors.

Comment on attachment 9131845 [details] [diff] [review]
bug1620950_print_broken.patch

Review of attachment 9131845 [details] [diff] [review]:
-----------------------------------------------------------------

I would still take this, as it's porting the mentioned bug. Making printing work again is would need this step, even if it's not complete.
Attachment #9131845 - Flags: review?(richard.marti)
Comment on attachment 9131845 [details] [diff] [review]
bug1620950_print_broken.patch

Okay, as partly fix.
Attachment #9131845 - Flags: review?(richard.marti) → review+
Target Milestone: --- → Thunderbird 76.0
See Also: → 1620314

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/d4e300e98f22
Port Bug 1602561. Make PrintUtils.printWindow() act on a BrowsingContext. r=Paenglab

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: