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

Bill Spitzak spitzak at gmail.com
Sun Oct 18 20:53:53 PDT 2015


On 10/17/2015 08:59 AM, Michael Catanzaro wrote:
> On Fri, 2015-10-16 at 18:43 -0700, Bill Spitzak wrote:
>> I think you misunderstood. The *destination* (if the cursor is still
>> pointing at it) is what sets the cursor.
>
> To clarify: you mean the destination sets the cursor as soon as the
> drop completes, correct? (Currently the source controls the cursor
> until the drop is performed.) I don't see any disagreement on that
> point: Carlos says that in drop_performed, the source "should reset its
> internal current cursor to the regular one for the next time the
> pointer enters the surface."

Did not see the word "internal" before, I misread the statement.

It does sound like you are relying on a client responding to an Enter 
event to change the cursor from whatever the DnD left it as to a normal 
pointer. This is (imho) correct.

Not sure if this should be mentioned as the statement is misleading. I 
don't think it is how a lot of clients will work, they will instead 
calculate the desired cursor at the moment they get the mouse-enter 
event. There is no "current cursor" to be "reset".

It seems you are assuming clients are written like this:

    static current_cursor;
    startDnD() { current_cursor = dnd_cursor; }
    endDnD() { current_cursor = normal_cursor; }
    on_mouse_enter() { wl_set_cursor(current_cursor); }

I expect it to work more like this:

    on_mouse_enter() {
      wl_set_cursor(is_dnd_running ? dnd_cursor : normal_cursor);
    }




More information about the wayland-devel mailing list