Hi

Am 28.09.19 um 08:58 schrieb ulli bei Unity:
>
> Hi,
>
> up to now I worked with the following dnd function. It worked very well,
> I could drop files and http-adresses from browser.
>
> Now I changed to Linux mint 19.2, dnd with files will not work anymore.
>
> Unfortunately the dnd function aren't well described.
>
> UH
>
>
> def create_drop_space cb
>   cb.drag_dest_set( Gtk::DestDefaults::ALL, [['text/plain', 0, 0]],
> Gdk::DragAction::COPY)


you should add

     cb.drag_dest_add_uri_targets

here, to also get URIs, which are used for file dropping.

>   cb.signal_connect('drag_data_received') do |w, context, x, y, data,
> info, time|
>   #Encoding.default_internal
>   type=data.text[0..4] # what is dropped ?
>   path=data.text[0..data.text.length] # length of dropped
>   aS=data.data
>   kwords=cb.active_iter[0].split(',')
>   save_dnd_data data, kwords

you should finalize the drag action with

        Gdk.drop_finish context, true, time

If you do not finish the drop action correctly, you may get unexpected
results. Sometimes it is seen as the drag-image flying back from the
drop point to the drag point

Hope it helps, cheers detlef




>   end
>
> end
>
>
>
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>


Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>