Re: Auto hided panels receiving DnD?

>  > George made button1 drag not copy to the same panel, so this explains
>  > that.  I'll talk to him and federico and see if we can get it all working
>  > the same as gmc.
>  What does gmc do?

GMC has some moderately tricky code to determine the drag and drop
semantics based on the type of data that is being dragged, the drag
source, and the drag destination.  The code to determine the DND
action to present the user with the correct feedback is in the
gdnd_validate_action() function in mc/gnome/gdnd.c.  Feel free to take
a look and steal ideas.

This has to be kept in sync with what the actual drag_data_received
handler does; the validation function must always present the correct
feedback that corresponds to the action that will be taken when the
data is actually dropped.

As for the semantics, they are the following[1]:  If no modidifer keys
are pressed and the drag comes from the same GMC process and the
destination is a directory, then the action is "move".  If the
destination is a normal file, then the action depends on whether it is
an executable or on whether there is a metadata or MIME-defined drop
action for it.  If the source is a different process, I think it uses
the suggested action in the drag context.  There are additional checks
to ensure that nothing happens if you drag something within the same
window into an empty area (i.e. the same directory).

For the GNOME panel, I think it should only allow dragging with mouse
button 2, and button 1 should be reserved for applets (the appropriate
motion/timeout combo to properly handle pasting strings is left as an
exercise to the reader).  Rationale:  it is inconsistent that you can
drag launchers with button 1, but you can't do the same with applets.
And we have a convention of using button 2 to move things around,

Of course this is inconsistent with the rest of the applications that
use button 1 for dragging, but I don't know what we could do about
it given that applets and launchers actually use button 1 for their
own purposes.

In any case, DND of launchers within the panel's panels should default
to moving, unless modifier keys are pressed.  I don't know if this was
ever fixed, so ignore me if it was.

(And in any case, if you resort to doing DND only with button 2 for
the panel, it should start the drag when you go past the panel's
border; when you are inside it you should just move and push
applets/launchers around in the usual fashion).

[1] But check gdnd_validate_action(), it is more reliable than my


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]