<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/125847/">https://git.reviewboard.kde.org/r/125847/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On February 17th, 2017, 7:43 p.m. UTC, <b>Martin Tobias Holmedahl Sandsmark</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/125847/diff/1/?file=413208#file413208line538" style="color: black; font-weight: bold; text-decoration: underline;">ui/presentationwidget.cpp</a>
<span style="font-weight: normal;">
(Diff revision 1)
</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">538</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span> <span class="n">e</span><span class="o">-></span><span class="n">type</span><span class="p">()</span> <span class="o">==</span> <span class="n">QEvent</span><span class="o">::</span><span class="n">Gesture</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">always use {}</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Fixed in latest upload.</p></pre>
<br />
<p>- Oliver</p>
<br />
<p>On February 17th, 2017, 8:06 p.m. UTC, Oliver Sander wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for Okular.</div>
<div>By Oliver Sander.</div>
<p style="color: grey;"><i>Updated Feb. 17, 2017, 8:06 p.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=354012">354012</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch adds support for swipe gestures to the presentation mode of okular. Swiping right-to-left goes to the previous page, swiping left-to-right goes to the next page.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Notes:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">1) The swipe gesture used here is a three-finger swipe, which is what the Qt QSwipeGesture class implements. I am not convinced that using three fingers is optimal here, but it is the easiest to implement. Other swiping gestures are possible, but you would need to implement a custom QGestureRecognizer. That would make the patch larger and more error-prone.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">2) Swiping from left to right(!) makes the presentation mode go to the next(!) slide. This is the opposite direction compared to what you do when you flip pages in a physical book, so it may feel strange. It is, however, the direction used in the qt5 gesture example at http://doc.qt.io/qt-5/gestures-overview.html Let me know if you want the directions reversed.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">3) By default, Qt5 synthesizes a mouse event for each unhandled touch event. In particular, a left mouse click is synthesized for each finger tap to the screen (which usually makes the presentation go to the next slide). This mechanism gets in the way of gesture recognition, because the first finger touch of your swipe gesture will already create a mouse-click and make your presentation go to the next page, irrespective of the swipe direction.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The patch solves this problem but switching off mouse event synthesis in presentation mode. That's the line</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">QCoreApplication</span><span style="color: #666666">:</span><span style="color: #AA22FF">:setAttribute</span><span style="color: #666666">(</span><span style="color: #008000; font-weight: bold">Qt</span><span style="color: #666666">:</span><span style="color: #AA22FF">:AA_SynthesizeMouseForUnhandledTouchEvents</span><span style="color: #666666">,</span><span style="color: #008000; font-weight: bold">false</span><span style="color: #666666">);</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">in the constructor of PresentationWidget. This has short-term side effects. For example, with this, you cannot finger-touch on a movie to start it anymore. The fix for this would be to implement proper handling of QTouchEvents, which should not be difficult.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">An alternative would be to leave mouse event synthesis turned on, but implement a dummy touch event handler. This will need only a few lines of code, but it will not avoid the side effects mentioned above.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">4) This patch applies to the 'frameworks' branch. I failed at backporting it to 'master'. There, the event loop would never receive any touchscreen events at all. This may be a Qt bug, but it may as well be my lack of experience.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Tested on a Thinkpad Yoga running Debian testing.</p></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>ui/presentationwidget.h <span style="color: grey">(69574d22)</span></li>
<li>ui/presentationwidget.cpp <span style="color: grey">(526c235e)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/125847/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>