[RFC weston] clients: Don't attach a buffer if mouse cursor surface is unchanged
derek.foreman.samsung at gmail.com
Tue Jul 24 21:45:41 UTC 2018
On 2018-07-22 05:55 AM, Daniel Stone wrote:
> Hey Derek,
> On Thu, 22 Feb 2018 at 22:16, Derek Foreman <derekf at osg.samsung.com> wrote:
>> Keep track of what cusor image buffer is attached to the cursor
>> surface and avoid re-attaching it if we don't have to.
>> This isn't just an obviously pointless optimization, it turns all
>> of toy toolkit into a test case for handling this properly.
>> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
>> Continuing my streak of posting unpopular patches, this patch breaks
>> weston, so I'm not pushing for inclusion, but I think we need to
>> resolve why it breaks, and fix either weston or wayland documentation
>> to reflect expected behaviour.
>> I think this can be attributed to a weston bug, and we should be able to
>> expect that the compositor will be able to redisplay the surface without
>> needing to attach a new buffer, and that if the compositor has released
>> the buffer then it has a kept copy somewhere...
>> Any other opinions?
> Hmm, I'm really not sure what to think about this.
> I take it the problem is that the client sets a particular surface as
> the pointer surface, loses focus, sets the same surface as the pointer
> surface on re-enter after not changing the content, and then the
> content is never shown?
That's my understanding of what I'm seeing, yes.
Note that it only happens when the cursor can be placed in the cursor
plane (ie: it's wayland_shm).
The old cursor continues to be shown - if I move into an EFL client from
the desktop, the desktop cursor arrow is sometimes unchanged.
I do get a surface enter for my pointer surface, though.
I'm reasonably confident the first time I saw this I would get no cursor
at all on re-enter, but now I get the existing cursor. Though sometimes
it updates to my client cursor, despite no damage or new buffer attach
on the surface.
> If so, the two solutions would be:
> - the surface content should be preserved across leave/enter; Weston
> is buggy for not showing the content on re-enter
> - mouse leave and your surface no longer being shown as a pointer
> surface causes the surface to lose that role; Wayland protocol spec
> should explicitly state this
Does losing the role imply the content is removed from the surface? If
so, yes, these are the only two options I can think of.
> I have a very slight lean towards the latter because it more closely
> matches my recollection of what the XDG roles do. But that
> recollection might be totally wrong, who knows.
I have no strong preference, though I won't have to fix my client code
to deal with the former. ;)
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
More information about the wayland-devel