Skip to content

gtkdroptarget: Fix setting preferred action from enter handler

Corey Berla requested to merge coreyberla/gtk:enter_action into main

The result from DropTarget::enter is ignore because the result DropTarget::motion is set immediately before DropTarget::enter. This causes the GdkDrop to have the incorrect action set, and subsequent calls to DropTarget::motion incorrectly set the preferred action (to an arbitrarily unique value).

This is particularly bad when DropTarget::enter is overridden and DropTarget::motion is not.

Add a new property GtkDropTarget self->preferred in order to capture the results from DropTarget::enter. The default handler for DropTarget::motion should simply return self->preferred.

Merge request reports