Bug 461996 - displayed aspect ratio changes when switching monitors?
Summary: displayed aspect ratio changes when switching monitors?
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 22.08.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-18 14:32 UTC by Eric
Modified: 2023-03-08 21:42 UTC (History)
2 users (show)

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


Attachments
two instances of okular showing different aspect ratios (264.41 KB, image/png)
2022-11-18 14:32 UTC, Eric
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric 2022-11-18 14:32:49 UTC
Created attachment 153866 [details]
two instances of okular showing different aspect ratios

SUMMARY

First, I'm on Ubuntu 22.10 and since upgrading to this version okular has never displayed the aspect ratio of a pdf correctly. It's squashed vertically. 

However, the displayed aspect ratio seems to change when switching from one external monitor to another. In the attached png file you can see two instances of okular. On the left is an instance I had open and then switched monitors (same resolution is set for both), and the aspect ratio is correct. The second instance of okular shown on the right is what I see whenever I open a new document, it is squashed vertically, which is easy to see in comparing the two.

STEPS TO REPRODUCE
1.  open file in okular, it is squashed vertically
2.  disconnect external monitor and reconnect or switch monitors

SOFTWARE/OS VERSIONS

Operating System: Kubuntu 22.10
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 5.19.0-23-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Manufacturer: Dell Inc.
Product Name: XPS 13 7390 2-in-1
Comment 1 Albert Astals Cid 2022-12-17 11:17:59 UTC
It would seem your monitor is broken and reports the wrong "dots per inch" information. Not much we can do really.

Why do we need the "dots per inch" information, so when you select 100% zoom the page on screen looks exactly like if would be if you printed it.

You can check which dops per inch okular thinks your monitor has by doing this:
 * start kdebugsettings
 * Write okular on the search bar
 * Change "Okular (Core)" to the first entry "Full Debug"
 * close kdebugsettings
 * Start okular from a terminal emulator (i.e. konsole)
 * Open a document

For me it says something like 
   org.kde.okular.core: Output DPI: QSizeF(141.767, 141.402)

Once you've done that you can reset back the Okular Core entry in kdebugsettings to just warnings so it's less verbose.

What's the value you get?
Comment 2 Eric 2022-12-17 14:19:48 UTC
I get:
org.kde.okular.core: Output DPI: QSizeF(338.667, 304.8)

The full output is below. What is the meaning of 'request observer'?

org.kde.okular.core: "/usr/lib/x86_64-linux-gnu/qt5/plugins/okular/generators/okularGenerator_poppler.so"
org.kde.okular.core: Output DPI: QSizeF(338.667, 304.8)
org.kde.okular.core: request observer=0x55937461aef0 547x637@2
org.kde.okular.core: request observer=0x55937461aef0 547x637@3
org.kde.okular.core: request observer=0x55937461aef0 547x637@4
org.kde.okular.core: sending request observer=0x55937461aef0 547x637@2 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@3
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@4
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@2
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@5
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@1
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@6
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@0
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@7
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2519@8
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2518@9
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@10
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@11
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@12
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@13
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@14
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@3
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@4
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@2
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@5
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@1
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@6
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@0
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@7
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2519@8
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2518@9
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@10
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@11
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@12
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@13
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@14
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@3
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@4
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@2
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@5
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@1
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@6
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@0
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@7
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2519@8
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2518@9
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@10
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@11
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@12
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@13
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@14
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@3
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@4
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@2
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@5
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@1
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@6
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@0
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@7
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2519@8
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2518@9
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@10
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@11
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@12
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@13
org.kde.okular.core: request observer=0x5593745b4aa0 1978x2303@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1978x2303@3 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@3
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@2
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@5
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@3
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@2
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@5
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@3 async == true isTile == false
org.kde.okular.core: sending request observer=0x55937461aef0 547x637@3 async == true isTile == false
org.kde.okular.core: sending request observer=0x55937461aef0 547x637@4 async == true isTile == false
org.kde.okular.core: request observer=0x55937461aef0 547x637@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@2
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@5
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@2
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@5
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@4 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@2
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@5
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@4
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@2
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@5
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@2 async == true isTile == false
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@5 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@1
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@1 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@6
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@6 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@0
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@0 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@7
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@7 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2492@8
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2492@8 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2491@9
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2491@9 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@10
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@10 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@11
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@11 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@12
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@12 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@13
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@13 async == true isTile == false
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: request observer=0x5593745b4aa0 1957x2279@14
org.kde.okular.core: sending request observer=0x5593745b4aa0 1957x2279@14 async == true isTile == false
Comment 3 Albert Astals Cid 2022-12-17 22:36:18 UTC
(In reply to Eric from comment #2)
> I get:
> org.kde.okular.core: Output DPI: QSizeF(338.667, 304.8)

This is when it works or when it doesn't?

> The full output is below. What is the meaning of 'request observer'?

nothing important here.
Comment 4 Eric 2022-12-17 23:02:59 UTC
When it does not.
Comment 5 Eric 2022-12-18 20:17:50 UTC
The way I set up the resolutions on both the laptop and the external monitor is through xrandr:

xrandr --output eDP-1 --mode 3840x2160 --output DP-3 --mode 1920x1080 --scale 2x2

These are both 16:9 aspect ratios. However, the physical laptop screen is 16:10. Can Okular be setting the aspect ratio on the physical laptop screen?

Note: All other KDE and GNOME pdf reader applications display the aspect ratio fine. It's only Okular that does not.
Comment 6 Albert Astals Cid 2022-12-22 21:43:54 UTC
You're forcing this on yourself by using the incorrect aspect ratio for your monitor, there's not much we can really do here.
Comment 7 Eric 2022-12-23 17:27:59 UTC
This is getting tiresome. Again, the only application that doesn't display PDF aspect ratio properly is Okular. Viewing in evince works fine, even viewing pdfs in emacs works fine. The aspect ratio of my external monitor is 16:9 and I set it to 1920x1080 which is 16:9, so I am not using the incorrect aspect ratio for my monitor. I am not a developer of KDE software and I don't know how Okular tries to determine the aspect ratio so I submitted this as a bug to help the development of Okular, which I like, and to hopefully learn more about how Okular works so that I could help contribute to a solution that may affect other people. Your vapid replies make me question if you even understand how Okular works.
Comment 8 Albert Astals Cid 2022-12-23 17:42:25 UTC
> Your vapid replies make me question if you even understand how Okular works.

ROTFL
Comment 9 Eric 2022-12-23 18:31:18 UTC
Yeah, that was funny. :-) But you still haven't answered the question so I must assume that you just don't know.
Comment 10 Albert Astals Cid 2022-12-23 19:04:22 UTC
(In reply to Eric from comment #9)
> Yeah, that was funny. :-) But you still haven't answered the question so I
> must assume that you just don't know.

I do know the answer I just don't react to cheap reverse psychology tricks because I'm not 3 year old.
Comment 11 Laurent 2023-03-08 21:26:35 UTC
I can confirm. Unfortunately, this seems to be a Qt issue.

Okular gets the DPI here, for the x and y axes separately:
https://invent.kde.org/graphics/okular/-/blob/master/core/utils.cpp#L52

X11 has the correct DPI, but Qt recomputes it as pixel_size / physical_size. This is baked on several levels, both in platform-independent code:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/kernel/qscreen.cpp?id=71c3aab7baae9220b37178711a49746f66975d63#n211
and in the low-level XCB code:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbscreen.cpp?id=71c3aab7baae9220b37178711a49746f66975d63#n104

It seems that physical_size does not come from the X11 display (as returned by xdpyinfo). This would have been fine because X11 fakes a reasonable physical size based on the monitors attached. Instead it comes from the monitor geometry either through xrandr or the EDID information.

This is a problem because it fails to account for the possibility of black bars on the top and bottom of the monitor when its aspect ratio does not match the resolution. Indeed Eric sets "xrandr --output eDP-1 --mode 3840x2160", which is 16:9, while also saying the monitor is 16:10.

I was not able to pinpoint the bug the Qt code. Hopefully someone else can. But I did check that QApplication::desktop()->widthMM() and QApplication::desktop()->heightMM() indeed return the physical monitor dimension regardless of black bars (which is perhaps not a bug in itself).
Comment 12 Laurent 2023-03-08 21:42:35 UTC
Note that there is already a workaround in the code for dealing with Qt returning bad DPI values:

https://invent.kde.org/graphics/okular/-/blob/master/core/utils.cpp#L54

> if (qAbs(res.width() - res.height()) / qMin(res.height(), res.width()) < 0.15) 

The code checks if the pixels are nonsquare by less than 15%. If not, it falls back on a default of 72 DPI. If my computations are correct, lowering the threshold to 10% would fix the problem for Eric.

The fallback could also be to force square pixels by discarding one axis, instead of discarding all DPI information. Proposed patch:

diff --git a/core/utils.cpp b/core/utils.cpp
index 9f5f47244..fec40da94 100644
--- a/core/utils.cpp
+++ b/core/utils.cpp
@@ -51,10 +51,11 @@ QSizeF Utils::realDpi(const QWindow *windowOnScreen)
     if (screen) {
         const QSizeF res(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY());
         if (res.width() > 0 && res.height() > 0) {
-            if (qAbs(res.width() - res.height()) / qMin(res.height(), res.width()) < 0.15) {
+            if (qAbs(res.width() - res.height()) / qMin(res.height(), res.width()) < 0.10) {
                 return res;
             } else {
                 qCDebug(OkularCoreDebug) << "QScreen calculation returned a non square dpi." << res << ". Falling back";
+                return QSizeF(res.width(), res.width());
             }
         }
     }