Bug 336018 - Horizontal resolution halved with 4k tiling monitor.
Summary: Horizontal resolution halved with 4k tiling monitor.
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.19.2
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 338145 338991 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-10 00:18 UTC by Con Kolivas
Modified: 2014-10-23 20:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.0


Attachments
Example of 4k width corruption (556.24 KB, image/png)
2014-07-15 06:14 UTC, Con Kolivas
Details
libokularcore with more debug (228.45 KB, application/x-deb)
2014-07-17 21:27 UTC, Albert Astals Cid
Details
libokularcore with some extra code to check for square dpis (228.42 KB, application/x-deb)
2014-07-17 23:06 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Con Kolivas 2014-06-10 00:18:59 UTC
On connecting a 4k monitor (Dell UltraSharp UP3214Q) in highres mode, which behaves like two virtual monitors side by side at a total resolution of 3840x2160, the pdf renderer gets confused about the horizontal resolution and displays every single pdf with the horizontal resolution precisely half the vertical resolution. Presumably it is confusing the full width of the display with the width of the virtual display which is precisely half.

Reproducible: Always

Steps to Reproduce:
1. Open pdf

Actual Results:  
Every pdf displayed is half width

Expected Results:  
Magnification should be consistent in vertical vs horizontal plane.

I don't see an obvious workaround in the pdf options making it unusable in its current form.
Comment 1 Albert Astals Cid 2014-06-17 21:39:34 UTC
Hi Con, we're having small problems with a new feature we introduced so that paper at 100% matches a real paper size (using the DPI for that). Some fix may have gone up to 0.19.1 (but it may still be broken since I can not reproduce it).

Could you try to update to 0.19.1? If not do you think you could try compiling some patch to see if it helps?
Comment 2 Albert Astals Cid 2014-06-17 21:45:50 UTC
Actually better try 0.19.2 instead of 0.19.1 :D
Comment 3 Christoph Feck 2014-07-15 02:16:15 UTC
If you can provide the information requested in comment #1, please add it.
Comment 4 Con Kolivas 2014-07-15 06:14:06 UTC
Created attachment 87735 [details]
Example of 4k width corruption

Confirmed still a problem on 0.19.2
Comment 5 Albert Astals Cid 2014-07-15 20:26:43 UTC
Would you be a able to try a small patch?
Comment 6 Con Kolivas 2014-07-15 22:18:13 UTC
I'm not really building kde binaries, they're the kubuntu distributed binaries as this is a desktop I need working well.
Comment 7 Albert Astals Cid 2014-07-15 22:53:27 UTC
Can you please run kdebugdialog enable all okular debug output, run okular opening that pdf file and attach the shell debug output?
Comment 8 Con Kolivas 2014-07-15 23:00:35 UTC
Is this what you mean?

okular(3621)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-con/ksycoca4"
okular(3621)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3621)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3621)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3621)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3621)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3621) KXMLGUI::ActionList::plug: Index  22  is not within range (0 -  15 
okular(3621)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(3621)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(3621)/kdecore (trader) KMimeTypeTrader::query: query for mimeType  "image/png" ,  "okular/Generator"  : returning  1  offers
okular(3621): BEGIN: Loading backend
This backend is only for XRandR 1.1, your version is:  1 . 4 
okular(3621)   BackendLoader::init: Skipping "XRandR 1.1" backend
okular(3621)   BackendLoader::init: Loading "XRandR" backend
okular(3621): END__: Loading backend [Took: 0.013s]
okular(3621) Okular::Utils::realDpi: Found widget at output # 641
okular(3621) Okular::Utils::realDpi: Output size is  QSize(698, 392)
okular(3621) Okular::Utils::realDpi: EDID WxH:  70 x 39
okular(3621) Okular::DocumentPrivate::openDocumentInternal: Output DPI: QSizeF(69.8682, 139.959)
okular(3621)/okular (app) Okular::Document::requestPixmaps: request observer=0x26f3478 1508x1654@0
okular(3621)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x26f3478 1508x1654@0 async == true isTile == false
okular(3621)/okular (app) Okular::Document::requestPixmaps: request observer=0x26f3478 1508x1654@0
okular(3621)/okular (app) Okular::Document::requestPixmaps: request observer=0x26f3478 1508x1654@0
okular(3621)/okular (app) Okular::Document::requestPixmaps: request observer=0x2650228 236x259@0
okular(3621)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x2650228 236x259@0 async == true isTile == false
okular(3621)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(3621)/kparts KParts::Part::~Part: deleting widget Sidebar(0x25cfe30) ""
Comment 9 Con Kolivas 2014-07-15 23:03:11 UTC
Actually that was the png file. This is the pdf file:

okular(3724)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-con/ksycoca4"
okular(3724)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3724)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3724)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3724)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3724)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(3724) KXMLGUI::ActionList::plug: Index  22  is not within range (0 -  15 
okular(3724)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(3724)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(3724)/kdecore (trader) KMimeTypeTrader::query: query for mimeType  "application/pdf" ,  "okular/Generator"  : returning  1  offers
okular(3724): BEGIN: Loading backend
This backend is only for XRandR 1.1, your version is:  1 . 4 
okular(3724)   BackendLoader::init: Skipping "XRandR 1.1" backend
okular(3724)   BackendLoader::init: Loading "XRandR" backend
okular(3724): END__: Loading backend [Took: 0.011s]
okular(3724) Okular::Utils::realDpi: Found widget at output # 641
okular(3724) Okular::Utils::realDpi: Output size is  QSize(698, 392)
okular(3724) Okular::Utils::realDpi: EDID WxH:  70 x 39
okular(3724) Okular::DocumentPrivate::openDocumentInternal: Output DPI: QSizeF(69.8682, 139.959)
okular(3724)/okular (app) Okular::Document::requestPixmaps: request observer=0xf3ac08 722x2045@0
okular(3724)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0xf3ac08 722x2045@0 async == true isTile == false
okular(3724)/okular (app) Okular::Document::requestPixmaps: request observer=0xf3ac08 722x2045@0
okular(3724)/okular (app) Okular::Document::requestPixmaps: request observer=0xf3ac08 722x2045@0
okular(3724)/okular (app) Okular::Document::requestPixmaps: request observer=0xf3ac08 692x1961@0
okular(3724)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0xf3ac08 692x1961@0 async == true isTile == false
okular(3724)/okular (app) Okular::Document::requestPixmaps: request observer=0xeab998 236x669@0
okular(3724)/okular (app) Okular::Document::requestPixmaps: request observer=0xf3ac08 692x1961@0
okular(3724)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0xeab998 236x669@0 async == true isTile == false
okular(3724)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(3724)/kparts KParts::Part::~Part: deleting widget Sidebar(0xe48520) ""
Comment 10 Albert Astals Cid 2014-07-15 23:16:07 UTC
Can you confirm that your monitor is

698x392mm

in size?
Comment 11 Con Kolivas 2014-07-16 00:12:03 UTC
Yes it is.
Comment 12 Albert Astals Cid 2014-07-16 23:51:24 UTC
Oh damn, i realized i'm missing some debug info i wanted to ask you about so you could check it.

You say you're using kubuntu. Would you be able to try a custom deb i build for you?
Comment 13 Con Kolivas 2014-07-17 01:16:05 UTC
Sure can.
Comment 14 Albert Astals Cid 2014-07-17 20:53:28 UTC
amd64 or i386?
Comment 15 Con Kolivas 2014-07-17 21:11:50 UTC
amd64 (async discussions FTW).
Comment 16 Albert Astals Cid 2014-07-17 21:27:56 UTC
Created attachment 87785 [details]
libokularcore with more debug

Can you run again, there should be more debug in the form of

okular(17965) Okular::Utils::realDpi: Found widget at output # 66
okular(17965) Okular::Utils::realDpi: Output size is (mm)  QSize(344, 193)
okular(17965) Okular::Utils::realDpi: Output rect is  QRect(0,0 1920x1080)
okular(17965) Okular::Utils::realDpi: EDID WxH (cm):  34 x 19
okular(17965) Okular::DocumentPrivate::openDocumentInternal: Output DPI: QSizeF(141.767, 142.135)
Comment 17 Con Kolivas 2014-07-17 21:47:57 UTC
okular(6811)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-con/ksycoca4"
okular(6811)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(6811)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(6811)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(6811)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(6811)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(6811) KXMLGUI::ActionList::plug: Index  22  is not within range (0 -  15 
okular(6811)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(6811)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(6811)/kdecore (trader) KMimeTypeTrader::query: query for mimeType  "application/pdf" ,  "okular/Generator"  : returning  1  offers
okular(6811): BEGIN: Loading backend
This backend is only for XRandR 1.1, your version is:  1 . 4 
okular(6811)   BackendLoader::init: Skipping "XRandR 1.1" backend
okular(6811)   BackendLoader::init: Loading "XRandR" backend
okular(6811): END__: Loading backend [Took: 0.011s]
okular(6811) Okular::Utils::realDpi: Found widget at output # 641
okular(6811) Okular::Utils::realDpi: Output size is (mm)  QSize(698, 392)
okular(6811) Okular::Utils::realDpi: Output rect is  QRect(0,0 1920x2160)
okular(6811) Okular::Utils::realDpi: EDID WxH (cm):  70 x 39
okular(6811) Okular::DocumentPrivate::openDocumentInternal: Output DPI: QSizeF(69.8682, 139.959)
okular(6811)/okular (app) Okular::Document::requestPixmaps: request observer=0x1ebf368 722x2045@0
okular(6811)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1ebf368 722x2045@0 async == true isTile == false
okular(6811)/okular (app) Okular::Document::requestPixmaps: request observer=0x1ebf368 722x2045@0
okular(6811)/okular (app) Okular::Document::requestPixmaps: request observer=0x1ebf368 722x2045@0
okular(6811)/okular (app) Okular::Document::requestPixmaps: request observer=0x1ebf368 692x1961@0
okular(6811)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1ebf368 692x1961@0 async == true isTile == false
okular(6811)/okular (app) Okular::Document::requestPixmaps: request observer=0x1e92178 236x669@0
okular(6811)/okular (app) Okular::Document::requestPixmaps: request observer=0x1ebf368 692x1961@0
okular(6811)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1e92178 236x669@0 async == true isTile == false
Comment 18 Albert Astals Cid 2014-07-17 22:22:06 UTC
This is confusing

So your monitor is
70x39 cm 
but the resolution is
1920x2160
?

I see, you have two virtual screens inside a single monitor. That is an interesting thing. Let me try to summit some experts on the matter.
Comment 19 Con Kolivas 2014-07-17 22:26:48 UTC
See my original comment about 4k monitors. Current 4k monitors are tiled like 2 screens side by side to generate their full resolution which is 3840x2160. Support across many applications is still in its infancy which is annoying but no other app currently renders things half width. If I click to make any app full screen it only ever chooses one tile or the other and fills up either the left tile or the right tile. However I can manually stretch a window across both tiles.
Comment 20 Con Kolivas 2014-07-17 22:29:58 UTC
Note I also manually set DPI to 144 myself in KDE to get the best behaviour in other apps, but I don't see any option anywhere to change DPI separately in two directions.

See also:
http://lists.x.org/archives/xorg-devel/2014-January/039984.html
Comment 21 Albert Astals Cid 2014-07-17 22:34:09 UTC
Can you attach the info of 

kscreen-console outputs

?
Comment 22 Con Kolivas 2014-07-17 22:36:24 UTC
kscreen-console outputs
START 
This backend is only for XRandR 1.1, your version is:  1 . 4 
Config::current() took 10 milliseconds 
KScreen version:  1.0.2.1 
Screen: 
        maxSize: QSize(16384, 16384) 
        minSize: QSize(8, 8) 
        currentSize: QSize(3840, 2160) 

-----------------------------------------------------
 
Id:  638 
Name:  "DVI-I-0" 
Type:  "Invalid Type" 
Connected:  false 

-----------------------------------------------------
 
Id:  639 
Name:  "DP-1.8" 
Type:  "DisplayPort" 
Connected:  true 
Enabled:  true 
Primary:  false 
Rotation:  1 
Pos:  QPoint(1920,0) 
MMSize:  QSize(698, 392) 
Size:  QSize(1920, 2160) 
Clones:  None 
Mode:  "640" 
Preferred Mode:  "640" 
Preferred modes:  ("640") 
Modes:  
         "640"    "1920x2160"   QSize(1920, 2160)   59.988 
EDID Info:  
        Device ID:  "xrandr-DELL UP3214Q-K3R9041H069P" 
        Name:  "DELL UP3214Q" 
        Vendor:  "" 
        Serial:  "K3R9041H069P" 
        EISA ID:  "" 
        Hash:  "6f961d13141f50d53ee14a60a1554b90" 
        Width:  70 
        Height:  39 
        Gamma:  2 
        Red:  QQuaternion(scalar:1, vector:(0.637695, 0.324219, 0)) 
        Green:  QQuaternion(scalar:1, vector:(0.210938, 0.713867, 0)) 
        Blue:  QQuaternion(scalar:1, vector:(0.151367, 0.0527344, 0)) 
        White:  QQuaternion(scalar:1, vector:(0.316406, 0.324219, 0)) 

-----------------------------------------------------
 
Id:  656 
Name:  "DVI-I-1" 
Type:  "Invalid Type" 
Connected:  false 

-----------------------------------------------------
 
Id:  657 
Name:  "HDMI-0" 
Type:  "HDMI" 
Connected:  false 

-----------------------------------------------------
 
Id:  641 
Name:  "DP-1.9" 
Type:  "DisplayPort" 
Connected:  true 
Enabled:  true 
Primary:  false 
Rotation:  1 
Pos:  QPoint(0,0) 
MMSize:  QSize(698, 392) 
Size:  QSize(1920, 2160) 
Clones:  None 
Mode:  "640" 
Preferred Mode:  "640" 
Preferred modes:  ("640") 
Modes:  
         "652"    "800x600"   QSize(800, 600)   75 
         "642"    "1920x1200"   QSize(1920, 1200)   59.8846 
         "653"    "800x600"   QSize(800, 600)   60.3165 
         "643"    "1920x1080"   QSize(1920, 1080)   60 
         "654"    "640x480"   QSize(640, 480)   75 
         "644"    "1680x1050"   QSize(1680, 1050)   59.9543 
         "655"    "640x480"   QSize(640, 480)   59.9405 
         "645"    "1600x1200"   QSize(1600, 1200)   60 
         "646"    "1280x1024"   QSize(1280, 1024)   75.0247 
         "647"    "1280x1024"   QSize(1280, 1024)   60.0197 
         "648"    "1280x800"   QSize(1280, 800)   59.8103 
         "649"    "1152x864"   QSize(1152, 864)   75 
         "650"    "1024x768"   QSize(1024, 768)   75.0286 
         "640"    "1920x2160"   QSize(1920, 2160)   59.988 
         "651"    "1024x768"   QSize(1024, 768)   60.0038 
EDID Info:  
        Device ID:  "xrandr-DELL UP3214Q-K3R9041H069P" 
        Name:  "DELL UP3214Q" 
        Vendor:  "" 
        Serial:  "K3R9041H069P" 
        EISA ID:  "" 
        Hash:  "d64ed731ea3ee5641ea25747bb740285" 
        Width:  70 
        Height:  39 
        Gamma:  2 
        Red:  QQuaternion(scalar:1, vector:(0.637695, 0.324219, 0)) 
        Green:  QQuaternion(scalar:1, vector:(0.210938, 0.713867, 0)) 
        Blue:  QQuaternion(scalar:1, vector:(0.151367, 0.0527344, 0)) 
        White:  QQuaternion(scalar:1, vector:(0.316406, 0.324219, 0)) 

-----------------------------------------------------
 
Id:  658 
Name:  "DP-0" 
Type:  "DisplayPort" 
Connected:  false 

-----------------------------------------------------
 
Id:  659 
Name:  "DVI-D-0" 
Type:  "Invalid Type" 
Connected:  false 

-----------------------------------------------------
 
Id:  660 
Name:  "DP-1" 
Type:  "DisplayPort" 
Connected:  false
Comment 23 Albert Astals Cid 2014-07-17 23:06:12 UTC
Created attachment 87786 [details]
libokularcore with some extra code to check for square dpis

This should fix your issue, can you confirm and attach the debug output?
Comment 24 Con Kolivas 2014-07-17 23:09:03 UTC
Comment on attachment 87786 [details]
libokularcore with some extra code to check for square dpis

Fixed! Beautiful work, thanks!

okular(8398)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-con/ksycoca4"
okular(8398)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(8398)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(8398)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(8398)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(8398)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(8398) KXMLGUI::ActionList::plug: Index  22  is not within range (0 -  15 
okular(8398)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(8398)/kparts KParts::ReadWritePart::setModified: setModified( false )
okular(8398)/kdecore (trader) KMimeTypeTrader::query: query for mimeType  "application/pdf" ,  "okular/Generator"  : returning  1  offers
okular(8398): BEGIN: Loading backend
This backend is only for XRandR 1.1, your version is:  1 . 4 
okular(8398)   BackendLoader::init: Skipping "XRandR 1.1" backend
okular(8398)   BackendLoader::init: Loading "XRandR" backend
okular(8398): END__: Loading backend [Took: 0.013s]
okular(8398) Okular::Utils::realDpi: Found widget at output # 641
okular(8398) Okular::Utils::realDpi: Output size is (mm)  QSize(698, 392)
okular(8398) Okular::Utils::realDpi: Output rect is  QRect(0,0 1920x2160)
okular(8398) Okular::Utils::realDpi: EDID WxH (cm):  70 x 39
okular(8398) Okular::Utils::realDpi: KScreen calculation returned a non square dpi. QSizeF(69.8682, 139.959) . Falling back
okular(8398) Okular::Utils::realDpiY: Pix: 2160 MM: 392
okular(8398) Okular::Utils::realDpiX: Pix: 3840 MM: 1414
okular(8398) Okular::Utils::realDpi: QDesktopWidget calculation returned a non square dpi. QSizeF(68.9788, 139.959) . Falling back
okular(8398) Okular::DocumentPrivate::openDocumentInternal: Output DPI: QSizeF(144, 144)
okular(8398)/okular (app) Okular::Document::requestPixmaps: request observer=0x1186fd8 1446x2046@0
okular(8398)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1186fd8 1446x2046@0 async == true isTile == false
okular(8398)/okular (app) Okular::Document::requestPixmaps: request observer=0x10f8c58 236x334@0
okular(8398)/okular (app) Okular::Document::requestPixmaps: request observer=0x1186fd8 1386x1961@0
okular(8398)/okular (app) Okular::Document::requestPixmaps: request observer=0x1186fd8 1386x1961@0
okular(8398)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x1186fd8 1386x1961@0 async == true isTile == false
okular(8398)/okular (app) Okular::DocumentPrivate::sendGeneratorPixmapRequest: sending request observer=0x10f8c58 236x334@0 async == true isTile == false
Comment 25 Albert Astals Cid 2014-07-20 20:31:35 UTC
Git commit 39de55eebf0641bd32fd0af9be7e2f50a9e2bbbc by Albert Astals Cid.
Committed on 20/07/2014 at 20:30.
Pushed by aacid into branch 'KDE/4.14'.

If the dpi calculations don't give a reasonably square pixel fallback to other methods
FIXED-IN: 4.14.0

M  +21   -2    core/utils.cpp

http://commits.kde.org/okular/39de55eebf0641bd32fd0af9be7e2f50a9e2bbbc
Comment 26 Albert Astals Cid 2014-09-10 21:56:11 UTC
*** Bug 338991 has been marked as a duplicate of this bug. ***
Comment 27 Jason Tiller 2014-09-10 22:50:13 UTC
Thank you for reviewing my submitted bug (here: https://bugs.kde.org/show_bug.cgi?id=338991) and marking it as a duplicate of this one.  I wanted to let you know that I installed the updated libokularcore attached to this ticket, and it solved my problem.  I hope that fact that I "downgraded" libokular core from 4.13.3 to 4.13.2+patch won't cause any issues.

Thanks again for your help, and I look forward to 4.14.0.
Comment 28 Christoph Feck 2014-09-11 21:38:42 UTC
> I look forward to 4.14.0.

4.14.0 has already been released on August 20th. But you can look forward to 4.14.1, which should hit the download servers next week :)
Comment 29 Christoph Feck 2014-10-23 20:58:05 UTC
*** Bug 338145 has been marked as a duplicate of this bug. ***