Bug 364016 - Courser does not disappear in full display mode.
Summary: Courser does not disappear in full display mode.
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: 2.0.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Mauro Carvalho Chehab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-06 09:44 UTC by tuxnix
Modified: 2016-06-09 07:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tuxnix 2016-06-06 09:44:51 UTC
Courser does not disappear in full display mode.
'(That's all)

Reproducible: Always

Steps to Reproduce:
1. Watch a video or a TV-show
2. Do a double-click to have full display mode.

Actual Results:  
You watch video with mouse courser. 
That is not perfect.

Expected Results:  
Courser has to disappear after some seconds without mouse action.
(And courser has to appear again when using mouse.)

Achlinux-Kaffeine 2.0.1-3
Comment 1 tuxnix 2016-06-06 21:05:10 UTC
There is a difference on that issue.
Starting kaffeine with plasma menu, courser does not disappear in full display mode.
Starting kaffeine with terminal command, courser disappears in full display mode.
Comment 2 Mauro Carvalho Chehab 2016-06-06 21:47:23 UTC
There's an issue with libVLC and Qt5.5 and upper.

The usual behavior of libVLC is to hide the cursor if it is not clicked or moved for a while, showing it again on movement. Qt5.5 and upper can be compiled with XInput2 support. This seems to be the default on distros, at least with Fedora and Debian. When Qt5.5 hooks with Input2, it stops sending mouse movements to libVLC.

This is docummented on this changeset:
https://quickgit.kde.org/?p=kaffeine.git&a=commitdiff&h=1192b9a9a884f9609ab3afb1e3a6708e49d967eb

There is an ugly hack for newer Qt4 at:

https://build.opensuse.org/package/view_file/openSUSE:Factory/vlc/vlc-qt5.5-mousepointer.patch?rev=50

But, for Qt5, I was recommended to re-compile Qt without XInput2 support, but, unfortunately, Qt5 doesn't offer any way to disable XInput2 support in runtime. 

What I did was to implement a code that would override the VLC behavior, explicitly showing the mouse again, and restoring the VLC hidden mouse if not changed for a while. This code is not 100%, due to the way Qt5 works.

On Qt5, AFAIK, there's only one command to hide a mouse: to call setCursor(Qt::BlankCursor). This function stores the old mouse on a stack. so, to unhide the mouse, one should call "unsetcursor()" with pops the previous mouse pointer from the stack. As VLC also sets the mouse to blank/arrow, the stacked way doesn't really work properly, as setCursor() may be saving either an arrow or blank.

I don't have any idea on how to fix it at Kaffeine, as the bug is really due to Qt5 and/or VLC. Suggestions are welcomed.
Comment 3 Mauro Carvalho Chehab 2016-06-06 22:10:53 UTC
(In reply to Mauro Carvalho Chehab from comment #2)

> On Qt5, AFAIK, there's only one command to hide a mouse: to call
> setCursor(Qt::BlankCursor). This function stores the old mouse on a stack.
> so, to unhide the mouse, one should call "unsetcursor()" with pops the
> previous mouse pointer from the stack. As VLC also sets the mouse to
> blank/arrow, the stacked way doesn't really work properly, as setCursor()
> may be saving either an arrow or blank.

Err.. actually the problem is with: setOverrideCursor(), with uses stack. The code to hide the cursor is:
       setCursor(Qt::BlankCursor);
       QApplication::setOverrideCursor();

Calling setOverrideCursor() saves the previous cursor at a stack, so a call to restoreOverrideCursor() is needed to restore the previous cursor.
Comment 4 Mauro Carvalho Chehab 2016-06-07 00:06:04 UTC
I found a logic that seems a way more reliable. On my tests, I'm getting consistent results when calling Kaffeine on Plasma, via Konsole and via a Mate desktop. So, I'm pushing the patch. Please let me know if it fixes the issue for you.
Comment 5 Mauro Carvalho Chehab 2016-06-07 00:06:19 UTC
Git commit 38a1b253a7f0ab3da61831921b0a202e4af49cc6 by Mauro Carvalho Chehab.
Committed on 07/06/2016 at 00:04.
Pushed by mauroc into branch 'master'.

vlcmediawidget: Improve the mouse unhide mechanism

There are still some troubles with the workaround for the
libVLC hide bug. So, change the logic to solve those issues.

Now, the hideMouse() function will not hide the mouse if
its position is outside the visible area of the play widget.

We're also getting rid of the setOverride stuff, as this
is not safe enough.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

M  +14   -10   src/backend-vlc/vlcmediawidget.cpp
M  +1    -0    src/backend-vlc/vlcmediawidget.h

http://commits.kde.org/kaffeine/38a1b253a7f0ab3da61831921b0a202e4af49cc6
Comment 6 tuxnix 2016-06-07 00:20:10 UTC
Thank you very much for all your good work here.
I will report you about plasma when next arch linux package arrives.
Comment 7 tuxnix 2016-06-09 07:37:43 UTC
Bug is fixed. Thank you.
Tested with Kaffeine 2.0.2-1, plasma-desktop 5.6.4-1 on archlinux 4.6.1-2