Bug 455384 - Okular blocks/hangs on print function
Summary: Okular blocks/hangs on print function
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: 22.04.1
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-16 07:41 UTC by Aditya Gupta
Modified: 2022-06-16 07:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Gupta 2022-06-16 07:41:50 UTC
SUMMARY

Currently, when printing a file (to a printer using lpr), okular blocks, and
1. Becomes unresponsive
2. No new files are opened, they will open only after it becomes responsive

This is especially noticeable on printing a large document (>20 pages for me)

STEPS TO REPRODUCE
1. Open a pdf file
2. Print to a printer (not file), may also choose Page set as Odd or even

OBSERVED RESULT
Okular becomes unresponsive. Cannot scroll. Cannot open new files.

EXPECTED RESULT
Okular keeps working, possibly showing a loading sign that "printing in process"

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4 (built against 5.15.3)

ADDITIONAL INFORMATION
## Possible solution

I thought it should be some call which is blocking on the main thread, so looking for it, I found this call:

https://invent.kde.org/graphics/okular/-/blob/master/core/fileprinter.cpp#L141

I think, instead of calling `doPrintFiles` should happen in another process (I am assuming, the pop-up window is a different process). I can't fix it, since I just don't know much Qt as of now :)