Created attachment 175885 [details] gdb trace of the Okular crash SUMMARY Trying to type text while the input window of the textwriter tool isn't in focus and then trying to save the text Okular crashes with a segfault (doesn't seem to matter what is entered either in the input field or while not focused) STEPS TO REPRODUCE 1. Open a PDF in Okular 2. Create a text-box using the typewriter annotation-tool 3. type something with the keyboard while the input window is out of focus 4. save the entered text (may be empty, doesn't matter) OBSERVED RESULT Okular crashes EXPECTED RESULT Okular doesn't crash SOFTWARE/OS VERSIONS Operating System: Garuda Linux Window manager: Hyprland 0.45.0 KDE Plasma Version: 6.2.3 KDE Frameworks Version: 6.8.0 Qt Version: 6.8.0 Kernel Version: 6.11.8-zen1-2-zen (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor Memory: 30.5 GiB of RAM Graphics Processor: AMD Radeon RX 7800 XT ADDITIONAL INFORMATION Also reproduced on my vanilla Arch laptop running cosmic
I noticed that it only happens if you enter a number while unfocused.
3. type something with the keyboard while the input window is out of focus What does this mean? Out of focus compared to what? Who has the focus?
The Typewriter input dialog pops up as an additional window. If I, however, focus the main okular window because the window focus follows my mouse, and enter a number (No input is written to the input field) which selects, for example, the Underline tool if 3 is pressed. I had a friend try to reproduce this on KDE (Manjaro) but there the window focus is forced on the Input field, so it is never possible to select another tool while initially creating the Typewriter text and, seemingly, thus doesn't crash okular.
Exactly, if window manager you are using doesn't enforce the restriction that the focus is only on the dialog and can't be on the window behind it, you need to file a bug against them.
I thought about that too, but I think that this still shouldn't cause okular to crash, but I understand, that this wouldn't be as high a priority.
What you are doing is "impossible", there is no need to protect the code against impossible things. The bug is in the Window Manager that let's you do impossible things.