Bug 499419 - Okular window loses focus after opening a password-protected file
Summary: Okular window loses focus after opening a password-protected file
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 24.12.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-02 15:25 UTC by Michal Kec (MiK)
Modified: 2025-02-05 14:26 UTC (History)
1 user (show)

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 Michal Kec (MiK) 2025-02-02 15:25:17 UTC
SUMMARY
When opening a password-protected file in Okular, the window does not automatically gain focus, which prevents users from interacting with the document using the keyboard. 
This issue makes it necessary to use the mouse to activate the Okular window, which is not ideal for keyboard users.

STEPS TO REPRODUCE
1. Open a password-protected file. A password prompt should appear.
2. Either enter a password or dismiss the prompt.
3. Use only the keyboard to interact with the document.

EXPECTED RESULT
You should be able to navigate the document/app using the keyboard immediately upon opening.

OBSERVED RESULT
The Okular window is not focused; instead, the window from which you opened the document remains focused.
Additionally, the Okular window does not appear in the Alt+Tab list, preventing you from activating it using the keyboard alone. 
However, Okular does show in the taskbar, requiring mouse usage to activate the window. Once activated with the mouse, the Okular window will then appear in the Alt+Tab list.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Graphics Processor: AMD Radeon RX 580 Series
Manufacturer: Gigabyte Technology Co., Ltd.
Comment 1 Justin Zobel 2025-02-05 12:09:14 UTC
I can't replicate this using Okular 24.12.1 from Flathub. I tested using https://download.novapdf.com/download/samples/pdf-example-password.pdf (password is "test"), right click and choose save as in your browser to download/test it.

Do you have some focus steal settings for Plasma in System Settings > Window Management > Window Behavior > Focus Tab that isn't deault?
Comment 2 Michal Kec (MiK) 2025-02-05 14:26:06 UTC
I have Okular 24.12.1 from KDE Neon DEB package.
I can 100% replicate with your PDF opened both from link by web browser or from disk by file manager.

> Do you have some focus steal settings for Plasma in System Settings > Window
> Management > Window Behavior > Focus Tab that isn't deault?

I have basic "Click to focus" settings. 
The only change here is unchecked "Separate screen focus" (on by default).
I've just tested with "Separate screen focus" checked -> still can replicate.

I use several window rules, but none of them should affect the Okular window.
I did not test the behavior under X11 though.