Bug 461001 - Restoring cursor visibility fails with Blender on Wayland with Tablet events
Summary: Restoring cursor visibility fails with Blender on Wayland with Tablet events
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.26.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2022-10-25 22:23 UTC by Campbell Barton
Modified: 2024-10-23 04:29 UTC (History)
1 user (show)

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 Campbell Barton 2022-10-25 22:23:31 UTC
On Blender, restoring cursor visibility fails, leaving the cursor entirely hidden.


STEPS TO REPRODUCE

Note that I have worked around this bug in Blender, see:

- To reproduce this bug, use a Blender build without the workaround, SHA1 `c4f9e4afab8c51e271fc6a313ccd2dd0b8d3186c` (using Blender's source with `make lite` is sufficient, or I can provide a build from our build-server if that's preferable).
- The issue has been worked around in `78b13ab3db70cca977585e29407445d2d1502fbf` (https://developer.blender.org/rB78b13ab3db70cca977585e29407445d2d1502fbf), which might give a hint to how this can be fixed.

**Exact steps for others to reproduce the error**
1. Load up default cube scene `blender --factory-startup`
2. Switch to the "Rotate tool" (on the left hand tool bar, 4th tool down from the top)
3. Use a tablet to click on the rotate gizmo and do some rotation.
4. Position the tablet cursor so it is not on the gizmo when the tablet press is released.
5. The mouse cursor is now hidden (UNEXPECTED BEHAVIOR)

OBSERVED RESULT

The cursor remains hidden on releasing the tablet press.

EXPECTED RESULT

The cursor should be visible (the default arrow cursor) when releasing the tablet press.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 5.26.1
KDE Plasma Version: 5.26.1
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION

- This seems like a bug as it only happens with tablet events, not mouse events.
- This issue doesn't occur in Gnome-shell (mutter 42.5).
- This is the up-stream bug report: https://developer.blender.org/T102048
Comment 1 Vlad Zahorodnii 2024-09-27 09:03:28 UTC
Can you test whether the issue occurs in Plasma 6.1 or 6.2? In Plasma 6, we have greatly refactored the cursor implementation in kwin.

If it is still reproducible, can you clarify

> * KDE (plasma 5.26.1) has a bug where the cursor surface needs to be committed
> * (via `wl_surface_commit`) when it was hidden and is being set to visible again, see: T102048.
> * TODO: report this bug up-stream. 

please? In general, in order to make a wl_surface visible again, you'll need to attach a buffer and commit it. Or is the problem that the wl_surface_commit needs to occur after zwp_tablet_tool_v2_set_cursor?
Comment 2 Bug Janitor Service 2024-10-12 03:47:51 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Campbell Barton 2024-10-23 04:28:29 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Can you test whether the issue occurs in Plasma 6.1 or 6.2? In Plasma 6, we
> have greatly refactored the cursor implementation in kwin.

Checked and the issue has been fixed in Plasma 6.2.

> If it is still reproducible, can you clarify
> 
> > * KDE (plasma 5.26.1) has a bug where the cursor surface needs to be committed
> > * (via `wl_surface_commit`) when it was hidden and is being set to visible again, see: T102048.
> > * TODO: report this bug up-stream. 
> 
> please? In general, in order to make a wl_surface visible again, you'll need
> to attach a buffer and commit it. Or is the problem that the
> wl_surface_commit needs to occur after zwp_tablet_tool_v2_set_cursor?

Right, the cursor was hidden UNLESS calling `wl_surface_commit` after  `zwp_tablet_tool_v2_set_cursor` .

This
Comment 4 Campbell Barton 2024-10-23 04:29:37 UTC
Closing as fixed, it would be good to know which version was fixed exactly (likely 6.0).