[PATCH wayland] protocol: Improve data source notification around DnD progress

Bill Spitzak spitzak at gmail.com
Fri Oct 16 18:43:36 PDT 2015


On Thu, Oct 1, 2015 at 12:57 PM, Carlos Garnacho <carlosg at gnome.org> wrote:

> On Thu, Oct 1, 2015 at 8:48 PM, Bill Spitzak <spitzak at gmail.com> wrote:
> >
> >
> > On Wed, Sep 30, 2015 at 1:45 PM, Carlos Garnacho <carlosg at gnome.org>
> wrote:
> >>
> >>
> >> - wl_data_source.drop_performed: Happens when the operation has been
> >>   physically finished (eg. the button is released), it could be the
> right
> >>   place to reset the pointer cursor back and undo any other state
> >> resulting
> >>   from the initial button press.
> >
> >
> > This should not be necessary. When the grab is lost, whatever client is
> > under the pointer should get an enter event and should then set the
> cursor
> > to whatever it wants. The dnd source should certainly not set the cursor
> in
> > this case because it may set it to the wrong one, resulting in a blink of
> > this wrong cursor (ie it will quickly change between the drag cursor, the
> > cursor the source thought it should be, and the actual cursor for that
> > screen location).
>
> Remember, toolkits preserve some state. The drag source is in control
> of the pointer cursor as long as the DnD operation holds, so it should
> reset its internal current cursor to the regular one for the next time
> the pointer enters the surface. And that's the bare minimals to be
> done there, in X11-land toolkits usually implemented DnD and its
> cursor changes through a grab, at least in the case of GTK+ this is
> carried on, and brings in a lot more side effects than just an
> extraneous cursor, so really can't wait until the next
> wl_pointer.enter.
>
>   Carlos
>

I think you misunderstood. The *destination* (if the cursor is still
pointing at it) is what sets the cursor. It should get an enter event the
moment the compositor finishes the state where the source can send drag
events, and can update the cursor. If the user moves the mouse fast enough
perhaps some client other than the destination would get the enter event,
and it should set the cursor.

Absolutely no way should the source try to do anything to the cursor. All
it might do is set it to the wrong image. It has no idea what cursor the
client being currently pointed at wants.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151016/1f92cd48/attachment.html>


More information about the wayland-devel mailing list