Commit Graph

4 Commits

Author SHA1 Message Date
Emmanuele Bassi
a3b9dba13c Fix annotation for GtkDropTarget.get_gtypes()
The argument name must match in the documentation, and the `allow-none`
annotation is deprecated, and should be replaced by `optional` in this
case.
2020-03-03 13:17:31 +00:00
Benjamin Otte
2e55c9cf8c droptarget: Fast-path local value load
This way, we can ensure that for local same-type drops the GValue
is set when ::enter is emitted.

This is the common case for dnd between widgets inside larger
applications, so it's worth it to speed it up.
2020-03-02 21:45:59 +01:00
Benjamin Otte
c0a63e6dd2 dnd: Fix some documentation gotchas 2020-03-02 21:26:08 +01:00
Benjamin Otte
a411959c91 droptarget: Redo
This is a huge reorganization of GtkDropTarget. I did not know how to
split this up, so it's unfortunately all one commit.

Highlights:

- Split GtkDropTarget into GtkDropTarget and GtkDropTargetAsync
  GtkDropTarget is the simple one that only works with GTypes and offers
  a synchronous interface.
  GtkDropTargetAsync retains the full old functionality and allows
  handling mime types.

- Drop events are handled differently
  Instead of picking a single drop target and sending all DND events to
  it, every event is sent to every drop target. The first one to handle
  the event gets to call gdk_drop_status(), further handlers do not
  interact with the GdkDrop.
  Of course, for the ultimate GDK_DROP_STARTING event, only the first
  one to accept the drop gets to handle it.
  This allows stacking DND event controllers that aren't necessarily
  interested in handling the event or that might decide later to drop
  it.

- Port all widgets to either of those
  Both have a somewhat changed API due to the new event handling.
  For the ones who should use the sync version, lots of cleanup was
  involved to operate on a sync API.
2020-03-02 03:18:55 +01:00