Bug 502482

Summary: D-Bus Methods in Okular Do Not Work Correctly for Specific Tabs
Product: [Applications] okular Reporter: matthiasschmitz1993
Component: generalAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 24.05.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description matthiasschmitz1993 2025-04-06 11:46:20 UTC
SUMMARY
When multiple pdfs are open in different tabs within the same Okular instance, D-Bus methods like currentPage, currentDocument, and goToPage do not behave as expected. 

STEPS TO REPRODUCE
1. In Okluar go to "Settings" -> "Configure Okular..." -> "General" -> activate "Open new files in tabs"
2. Open multiple pdfs in tabs of the same Okular instance
3.  Run "qdbus org.kde.okular-{PROCESS ID} /okular org.kde.okular.currentPage"

OBSERVED RESULT
The method (currentPage) always returns a result for the initially opened document and not the currently activate tab. The same issue occurs with other methods (e.g., currentDocument, slotPreviousPage, slotNextPage, etc...).

If the tab of the initially opened document is closed, but the okular instance is still open with another document, then qdbus returns an error.

EXPECTED RESULT
I would expect the methods to work for the currently active tab by default. I would also expect an option to use the methods on multiple different tabs, even when not active.

SOFTWARE/OS VERSIONS
Linux: Ubuntu 24.10
okular: 24.05.2
Qt Version: 5.15.15