Discussion:
[kwin] [Bug 401921] New: Cursor is duplicated on Kodi 18 RC2 running natively under Wayland
Patrick Silva
2018-12-09 10:15:11 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

Bug ID: 401921
Summary: Cursor is duplicated on Kodi 18 RC2 running natively
under Wayland
Product: kwin
Version: 5.14.4
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: wayland-generic
Assignee: kwin-bugs-***@kde.org
Reporter: ***@gmx.com
Target Milestone: ---

STEPS TO REPRODUCE
1. start Wayland session
2. install Kodi 18 RC2 via flatpak/flathub
3. open Kodi and move the cursor

OBSERVED RESULT
two cursors are visible


EXPECTED RESULT
only one cursor should be visible

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.14.4
KDE Frameworks Version: 5.52
Qt Version: 5.12

ADDITIONAL INFORMATION
already reported to Kodi devs.
https://github.com/xbmc/xbmc/issues/15002

"The two pointer objects are not the problem, I tested by disabling one of
them. Wayland debug logs show that the cursor image is set to null, which
according to the specification means that the cursor has to be hidden. KWin
does not do this for whatever reason - it works on GNOME and Weston. I
recommend you to retry with the latest possible version of KWin (preferably
built from Git master) and if your problem persists report it to the KDE
people."
--
You are receiving this mail because:
You are watching all bug changes.
Patrick Silva
2018-12-09 10:15:37 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

Patrick Silva <***@gmx.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Platform|Other |Archlinux Packages
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-12-10 10:54:26 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #9 from Martin Flöser <***@kde.org> ---
I'm not on IRC.
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-12-10 09:46:13 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #8 from ***@casix.org ---
I've tried in a full Plasma session now and it seems the problem with one
wl_pointer not reacting to set_cursor(NULL) (as with weston-confine) is limited
to running KWin in X11 or Wayland nested mode.
Still a bug, but whatever.

I'm curious about what problem pointer locking will solve once the double
wl_pointer is sorted out, but this is clearly not the place to discuss that.
I'll try to hit you up on IRC.
--
You are receiving this mail because:
You are watching all bug changes.
Patrick Silva
2018-12-09 15:08:05 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #4 from Patrick Silva <***@gmx.com> ---
Created attachment 116811
--> https://bugs.kde.org/attachment.cgi?id=116811&action=edit
complete output of wayland_debug
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-12-09 17:31:36 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

Martin Flöser <***@kde.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|REPORTED |RESOLVED
Resolution|--- |NOT A BUG

--- Comment #5 from Martin Flöser <***@kde.org> ---
After analyzing the debug output it looks like kodi is doing some things wrong.
It creates two wl_pointer objects as described in the github issue. On one of
them it sets a null cursor. On the other one it doesn't set a cursor at all.
Given that we should have no cursor - neither from Kodi nor from KWin. This
means that Kodi is also drawing it's own cursor. But Kodi is not using the
Wayland protocols for such an interaction. It should use the pointer
constraints interface and lock the cursor and use the relative pointer
interface for motion when the cursor is locked.

I'm setting this bug report to not a bug on our side.
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-12-09 14:03:31 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #3 from Martin Flöser <***@kde.org> ---
The log is incomplete. You need to redirect everything to a file.
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-12-09 23:27:50 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

***@casix.org changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@casix.org

--- Comment #6 from ***@casix.org ---
(In reply to Martin Flöser from comment #5)
Post by Martin Flöser
After analyzing the debug output it looks like kodi is doing some things
wrong.
There is nothing in the specification that forbids creating two wl_pointer
objects. It is also not connected to the bug. As described in the GH issue,
using only one wl_pointer does not change anything.
Post by Martin Flöser
It creates two wl_pointer objects as described in the github issue.
On one of them it sets a null cursor. On the other one it doesn't set a
cursor at all. Given that we should have no cursor - neither from Kodi nor
from KWin. This means that Kodi is also drawing it's own cursor.
Yes.
Post by Martin Flöser
But Kodi is not using the Wayland protocols for such an interaction. It should use the
pointer constraints interface and lock the cursor and use the relative
pointer interface for motion when the cursor is locked.
In Kodi, the cursor is part of the skin and cannot easily be put in its own
surface.
Anyway, both pointer-constraints and relative-pointer are not directly related
to showing or not showing the cursor image. That is, using them would not solve
the problem at hand, and I don't really see how they would benefit our use-case
in the first place.
Post by Martin Flöser
I'm setting this bug report to not a bug on our side.
I don't see how you come to this conclusion.
You said yourself: "Given that we should have no cursor - neither from Kodi nor
from KWin" - so KWin should not draw a cursor in this case. Yet, it does,
violating the Wayland protocol.

I actually made a MWE, but it's even simpler. Try weston-confine. The cursor
should disappear over the window, and it does so on GNOME and Weston. It stays
visible on KWin.
--
You are receiving this mail because:
You are watching all bug changes.
Patrick Silva
2018-12-09 11:48:58 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #2 from Patrick Silva <***@gmx.com> ---
Created attachment 116802
--> https://bugs.kde.org/attachment.cgi?id=116802&action=edit
wayland_debug
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-12-10 05:39:06 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #7 from Martin Flöser <***@kde.org> ---
Please do things as intended by the Wayland protocols:
* Set a null surface on all pointer objects
* Use pointer locking and relative pointer

Drawing your own cursor without locking won't work - nowhere. The cursor might
get warped or similar and then the pointer position is wrong. We can see that
in the screenshot, the pointer positions of the two cursors are not identical.
If you want to draw your own cursor, use locking - that's the intended
interface for it.

I'm refusing to investigate non issues. Rendering own cursor without locking is
not supported.
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-12-09 11:06:30 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #1 from Martin Flöser <***@kde.org> ---
Please attach the output of WAYLAND_DEBUG. KWin in general does support the
hiding of the cursor, so something might be wrong in the event sequence.
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-12-10 21:14:16 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #10 from ***@casix.org ---
Fair enough (and I gather that you are not interested in continuing this
discussion). Thanks for your input so far.
--
You are receiving this mail because:
You are watching all bug changes.
Christoph Feck
2018-12-10 23:32:06 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401921

--- Comment #11 from Christoph Feck <***@kde.org> ---
Your conclusion is not really correct. Martin hasn't been on IRC since ages. If
you still believe there is an issue in KWin, you could also use the kwin
mailing list to discuss it or to share minimal working examples.
--
You are receiving this mail because:
You are watching all bug changes.
Loading...