D17929: Hide cursor when tablet stylus leaves proximity of the screen
Oliver Sander
noreply at phabricator.kde.org
Wed Jan 2 20:33:30 GMT 2019
sander created this revision.
sander added a reviewer: Okular.
Herald added a project: Okular.
Herald added a subscriber: okular-devel.
sander requested review of this revision.
REVISION SUMMARY
This patch fixes the following papercut: I regularly write on pdf files in presentation mode, using the styles that comes with my laptop. When I approach the screen with the pen, the cursor appears, and it follows the pen tip during writing. When I lift off the pen, the cursor stays on, and auto-hides only a few seconds later (because of Okular::Settings::EnumSlidesCursor::HiddenDelay). As a consequence, the cursor frequently hides the last bits of what I have just written. This is a nuisance.
With this patch, Okular catches the TabletEnterProximity and TabletLeaveProximity events. The former will make the cursor turn into a cross-hair; the latter will make it disappear directly, unless the cursor mode is 'always visible'.
There is one drawback to this patch. With the cursor mode HiddenDelay, the cursor disappears after a short time, and should reappear at the next mouse move. This does not work if the cursor has been hidden by TabletLeaveProximity, and I don't understand why. The patch therefore currently adds code to mouseMoveEvent that explicitly brings the cursor back. Any help on how to debug this (or an explanation of why it is necessary) is much appreciated.
TEST PLAN
- Enter presentation mode
- Approach the screen with a stylus. The cursor (appears if it was invisible before and) turns into a cross hair, before the stylus even actually touches the screen.
- Remove the stylus again: if the cursor mode is Visible, the cursor turns into an arrow, otherwise it is hidden.
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D17929
AFFECTED FILES
ui/presentationwidget.cpp
ui/presentationwidget.h
To: sander, #okular
Cc: okular-devel, ngraham, darcyshen, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20190102/05b77355/attachment.html>
More information about the Okular-devel
mailing list