We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2485 - [PATCH] Wayland: cursor disappears permanently after window loses mouse focus
Summary: [PATCH] Wayland: cursor disappears permanently after window loses mouse focus
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86 Linux
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-08 20:07 UTC by Bryan Cain
Modified: 2014-04-18 03:52 UTC (History)
2 users (show)

See Also:


Attachments
Patch that fixes this bug (3.67 KB, patch)
2014-04-08 20:07 UTC, Bryan Cain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Cain 2014-04-08 20:07:23 UTC
Created attachment 1610 [details]
Patch that fixes this bug

Using any SDL application with the Wayland backend under Weston, if the application sets a cursor with SDL_SetCursor, the cursor will work until the mouse pointer leaves the window.  When the pointer re-enters the window, there will be no cursor displayed at all.

I did some digging, and the reason for this is that SDL attaches the buffer to the cursor surface only once (during cursor creation) and assumes that it will stay attached.  This is not how Wayland works, though - once the compositor is done rendering the buffer, it will release it, so it is no longer attached to the surface.  When the cursor re-enters the window a second time, SDL sets the cursor to the same surface with no buffer attached, so no cursor is displayed.

This is fixed by the attached patch, which makes SDL attach the buffer to the surface when the cursor is set, not when it is created.
Comment 1 Sam Lantinga 2014-04-18 03:52:06 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/46f85bfe9303