Commit 0dd54196 authored by Albert Astals Cid's avatar Albert Astals Cid

Hide the cursor with tricks so then hidden delay mode keeps working fine

parent b1b2f93e
......@@ -1858,7 +1858,7 @@ void PartTest::testTabletProximityBehavior()
QVERIFY( w->cursor().shape() == Qt::CursorShape( Qt::BlankCursor ) );
// Moving the mouse should bring the cursor back
QTest::mouseMove(w, QPoint( 100, 100 ));
QTest::mouseMove(w, QPoint( 150, 150 ));
QVERIFY( w->cursor().shape() == Qt::CursorShape( Qt::ArrowCursor ) );
}
......
......@@ -544,15 +544,16 @@ bool PresentationWidget::eventFilter (QObject *o, QEvent *e )
{
setCursor( QCursor( Qt::CrossCursor ) );
}
if ( e->type() == QTabletEvent::TabletLeaveProximity )
else if ( e->type() == QTabletEvent::TabletLeaveProximity )
{
if ( Okular::Settings::slidesCursor() == Okular::Settings::EnumSlidesCursor::Visible )
{
setCursor( QCursor( Qt::ArrowCursor ) );
}
else
{
setCursor( QCursor( Qt::BlankCursor ) );
setCursor( QCursor( Okular::Settings::slidesCursor() == Okular::Settings::EnumSlidesCursor::Hidden ? Qt::BlankCursor : Qt::ArrowCursor ) );
if ( Okular::Settings::slidesCursor() == Okular::Settings::EnumSlidesCursor::HiddenDelay) {
// Trick KCursor to hide the cursor if needed by sending an "unknown" key press event
// Send also the key release to make the world happy even it's probably not needed
QKeyEvent kp( QEvent::KeyPress, 0, Qt::NoModifier );
qApp->sendEvent( this, &kp );
QKeyEvent kr( QEvent::KeyRelease, 0, Qt::NoModifier );
qApp->sendEvent( this, &kr );
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment