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

Drracket prints definitions as blank pages #336

Open
chihyang opened this issue Sep 15, 2024 · 1 comment
Open

Drracket prints definitions as blank pages #336

chihyang opened this issue Sep 15, 2024 · 1 comment

Comments

@chihyang
Copy link
Contributor

This issue is related to racket/drracket#465. On Linux, "File > Print definitions... > [print dialogue opens]" generates empty pages. This is tested with both Racket 8.13 and 8.14 on multiple Linux distro. And it seems the problem has existed for a while. 8.13 and 8.14 are not the only two versions that suffer from it. My tests show that disabling asynchronous operation in the following line fixes this problem. The reason for that is still not clear. But it should be safe for now to just disable asynchronous printing.

(gtk_print_operation_set_allow_async op-gtk #t)

chihyang added a commit to chihyang/gui that referenced this issue Sep 15, 2024
Fix issue racket#336: for unknown reasons, asynchronous printing in GTK3 generates
blank pages.  Disabling asynchronous mode fixes this problem.  This change makes
the main window freeze when the print dialog is popped up.  But it shouldn't be
a problem.  First this is also the default behavior when the print dialog is
popped up in Windows.  This change makes the behavior more consistent on
different OSes.  Besides, it is reasonable to forbid editing when the contents
of the editor is being printed.
chihyang added a commit to chihyang/gui that referenced this issue Sep 15, 2024
Fix issue racket#336: for unknown reasons, asynchronous printing in GTK3 generates
blank pages.  Disabling asynchronous mode fixes this problem.  This change makes
the main window freeze when the print dialog is popped up.  But it shouldn't be
a problem.  First this is also the default behavior when the print dialog is
popped up in Windows.  This change makes the behavior more consistent on
different OSes.  Besides, it is reasonable to forbid editing when the contents
of the editor is being printed.
@chihyang
Copy link
Contributor Author

chihyang commented Sep 19, 2024

More info about the test: this issue has been reproduced with Racket 5.3.4 on Ubuntu 16.04. On Ubuntu 22.04, all versions starting from 6.6 can also reproduce it (older Racket failed to run on my machine). Not every print produces a blank file. Sometimes the printed file is incomplete with the last few pages blank; sometimes all pages are blank; sometimes the printed file is normal. All these make it look more like a synchronization problem. Since it can be reproduced on much older versions of Racket, disabling async mode of GTK printing should be a good option.

mflatt pushed a commit that referenced this issue Sep 19, 2024
Fix issue #336: for unknown reasons, asynchronous printing in GTK3 generates
blank pages.  Disabling asynchronous mode fixes this problem.  This change makes
the main window freeze when the print dialog is popped up.  But it shouldn't be
a problem.  First this is also the default behavior when the print dialog is
popped up in Windows.  This change makes the behavior more consistent on
different OSes.  Besides, it is reasonable to forbid editing when the contents
of the editor is being printed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant