Bug 455384

Summary: Okular blocks/hangs on print function
Product: [Applications] okular Reporter: Aditya Gupta <ag15035>
Component: printingAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: minor    
Priority: NOR    
Version First Reported In: 22.04.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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 :)