<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/111829/">https://git.reviewboard.kde.org/r/111829/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On October 1st, 2013, 11:37 p.m. CEST, <b>Albert Astals Cid</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/111829/diff/6/?file=183816#file183816line116" style="color: black; font-weight: bold; text-decoration: underline;">core/utils.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 6)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">116</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">QSize</span> <span class="n">szMM</span> <span class="o">=</span> <span class="n">selectedOutput</span><span class="o">-></span><span class="n">sizeMm</span><span class="p">();</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hmmm, my libkscreen does not have sizeMm, what libkscreen version are you using?</pre>
 </blockquote>



 <p>On October 1st, 2013, 11:46 p.m. CEST, <b>Eugene Shalygin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The changes were accepted into master branch of libkscreen some time ago, and I do not know when they will be released</pre>
 </blockquote>





 <p>On October 2nd, 2013, 12:49 a.m. CEST, <b>Albert Astals Cid</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ok, we'll have to wait until it gets released since otherwise the code is not compiling at the moment for people running released versions of stuff. It'd be cool if you can warn us once there's a released version of libkscreen we can use.</pre>
 </blockquote>





 <p>On October 2nd, 2013, 12:59 a.m. CEST, <b>Eugene Shalygin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The change was commited on the next day after 1.0.1 tag. So, no problem, I'll ping here. Does it mean that you do not have any other objections? ;)</pre>
 </blockquote>





 <p>On October 2nd, 2013, 8:22 p.m. CEST, <b>Albert Astals Cid</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Can't tell if i have more objections until i can compile and run the stuff, i defenitely want to try how hard is to get away from using pixels and back to points, but i'll try that myself once i get this thing compiling properly.</pre>
 </blockquote>





 <p>On November 20th, 2013, 12:37 a.m. CET, <b>Eugene Shalygin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Version 1.0.2 of libkscreen was released --- http://download.kde.org/stable/libkscreen/1.0.2/</pre>
 </blockquote>





 <p>On January 6th, 2014, 3:34 p.m. CET, <b>Eugene Shalygin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">ping?</pre>
 </blockquote>





 <p>On January 11th, 2014, 6:46 p.m. CET, <b>Albert Astals Cid</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">on it sorry, been busy</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">OK. Do we have a chance to make it done for 4.13?</pre>
<br />




<p>- Eugene</p>


<br />
<p>On August 21st, 2013, 2:56 a.m. CEST, Eugene Shalygin wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Okular and Albert Astals Cid.</div>
<div>By Eugene Shalygin.</div>


<p style="color: grey;"><i>Updated Aug. 21, 2013, 2:56 a.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=268757">268757</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
okular
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch relies on master branch of LibKScreen.
This patch does not solve the problem in bug completely, but makes Okular behaviour more correct (see below).

The problem (in the bug) is that Okular uses fixed DPI for PDF rendering (72.0 dots per inch) and therefore scale of rendered document becomes incorrect. With current mainline laptop screens having DPI easily twice larger than this constant (72), the problem shows itself quiet strongly.

Additional problems araise with multiscreen configuration, when 1) DPI of each individual screen may be different, and 2) there is no tools in Qt to detect DPI of individual screens in virtual desktop mode. Therefore XRandr has to be used for DPI detection. Raw XRandr is bad dependency for Okular and libkscreen is proposed instead.

This patch approach to the solution in the following way:
1. libkscreen detection staff is added to CMakeLists.txt and config.h
2. It changes Utils::realDpi() function to use libkscreen if present. With libkscreen the function looks for output that contains maximal part of given widget (suppose to be used for document rendering) and returns DPI of that screen.
3. Genenerator interface is extended by adding UtilizeDPI feature and setDPI() method, that is called by Document class right before calling loadXXX() if the generator supports this feature
4. Poppler generator is changed to support UtilizeDPI feature.
5. PageSizeMetric enum is extended with Pixels value to explicitly say that page size is defined in screen pixels (see my posts in the bug); Poppler generator uses this case.


To completetly fix the bug, Document must invalidate generated pixmaps after the widget movements into another screen. I do not know how to track this without subclassing the main window class. Therefore I decided to publish this part of work to get your responce, especially regarding item 3 (Generator class changes).

In the current state, manual reloading of a document after moving Okular to another screen fixes the scale, that is, in my eyes, is quiet helpful already.

Even if we subclass the Okular main window, I do not know what to do when Okular is used as KPart. 
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Manual. In all screens, that report correct physical size to XRandr, size of documents is correct</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>CMakeLists.txt <span style="color: grey">(217337f)</span></li>

 <li>config-okular.h.cmake <span style="color: grey">(7217f8d)</span></li>

 <li>core/document.cpp <span style="color: grey">(3af92c8)</span></li>

 <li>core/generator.h <span style="color: grey">(a5a971b)</span></li>

 <li>core/generator.cpp <span style="color: grey">(41beb92)</span></li>

 <li>core/generator_p.h <span style="color: grey">(b59293a)</span></li>

 <li>core/utils.h <span style="color: grey">(8d5d5fc)</span></li>

 <li>core/utils.cpp <span style="color: grey">(5dd8448)</span></li>

 <li>generators/poppler/generator_pdf.h <span style="color: grey">(5d5853a)</span></li>

 <li>generators/poppler/generator_pdf.cpp <span style="color: grey">(1a44523)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/111829/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>