Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring "resize" events during printing (issue 15324) #15325

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

This is a quick work-around, to prevent the viewer from breaking as a result of https://bugzilla.mozilla.org/show_bug.cgi?id=774398

@Snuffleupagus
Copy link
Collaborator Author

Although it just occurred to me that this isn't really a good idea as-is, since the user can still manually re-size the browser window during printing and those events we still want to handle...
We really only want to ignore the "resize" events that come specifically from the print-preview being opened, but I don't know if and how that could be done?

@Snuffleupagus Snuffleupagus marked this pull request as draft August 16, 2022 11:16
@calixteman
Copy link
Contributor

I logged media changes (similarly to what is done in the test case in https://bugzilla.mozilla.org/show_bug.cgi?id=774398#c0) and window resize events, one resize is triggered between "before printing" and "after printing", so maybe this one could be ignored.
A second one is triggered after the "after printing" in order to restore the size changed during the printing.

This is a quick work-around, to prevent the viewer from breaking as a result of https://bugzilla.mozilla.org/show_bug.cgi?id=774398
@Snuffleupagus
Copy link
Collaborator Author

I logged media changes (similarly to what is done in the test case in https://bugzilla.mozilla.org/show_bug.cgi?id=774398#c0) and window resize events, one resize is triggered between "before printing" and "after printing", so maybe this one could be ignored.

It seems like this worked, thank you!
However, note that I've only tested with the development viewer so I cannot confirm that it also fixes the Firefox built-in viewer unfortunately (and it's too hot today for me to build Firefox locally).

@mozilla mozilla deleted a comment from pdfjsbot Aug 16, 2022
@mozilla mozilla deleted a comment from pdfjsbot Aug 16, 2022
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/641ce7637bc7169/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/641ce7637bc7169/output.txt

Total script time: 2.69 mins

Published

@calixteman
Copy link
Contributor

I'll try it with local build.
FYI, you can use the artifact mode:
https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html
then you can update pdf.js stuff in your local clone and just run ./mach build faster (nowadays it works pretty well on Windows).
This way you don't need to build the entire Firefox which can take a while....

@calixteman
Copy link
Contributor

WFM with a local build.

@Snuffleupagus Snuffleupagus marked this pull request as ready for review August 16, 2022 12:23
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zoom level is changing after printing
3 participants