mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
Add a default handler for drag_failed
And use it in notebook dnd.
This commit is contained in:
parent
e6693ab840
commit
9baf24f87e
@ -371,8 +371,7 @@ static void gtk_notebook_drag_end (GtkWidget *widget,
|
|||||||
GdkDragContext *context);
|
GdkDragContext *context);
|
||||||
static gboolean gtk_notebook_drag_failed (GtkWidget *widget,
|
static gboolean gtk_notebook_drag_failed (GtkWidget *widget,
|
||||||
GdkDragContext *context,
|
GdkDragContext *context,
|
||||||
GtkDragResult result,
|
GtkDragResult result);
|
||||||
gpointer data);
|
|
||||||
static gboolean gtk_notebook_drag_motion (GtkWidget *widget,
|
static gboolean gtk_notebook_drag_motion (GtkWidget *widget,
|
||||||
GdkDragContext *context,
|
GdkDragContext *context,
|
||||||
gint x,
|
gint x,
|
||||||
@ -665,6 +664,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
|||||||
widget_class->drag_drop = gtk_notebook_drag_drop;
|
widget_class->drag_drop = gtk_notebook_drag_drop;
|
||||||
widget_class->drag_data_get = gtk_notebook_drag_data_get;
|
widget_class->drag_data_get = gtk_notebook_drag_data_get;
|
||||||
widget_class->drag_data_received = gtk_notebook_drag_data_received;
|
widget_class->drag_data_received = gtk_notebook_drag_data_received;
|
||||||
|
widget_class->drag_failed = gtk_notebook_drag_failed;
|
||||||
widget_class->compute_expand = gtk_notebook_compute_expand;
|
widget_class->compute_expand = gtk_notebook_compute_expand;
|
||||||
|
|
||||||
container_class->add = gtk_notebook_add;
|
container_class->add = gtk_notebook_add;
|
||||||
@ -1202,9 +1202,6 @@ gtk_notebook_init (GtkNotebook *notebook)
|
|||||||
notebook_targets, G_N_ELEMENTS (notebook_targets),
|
notebook_targets, G_N_ELEMENTS (notebook_targets),
|
||||||
GDK_ACTION_MOVE);
|
GDK_ACTION_MOVE);
|
||||||
|
|
||||||
g_signal_connect (G_OBJECT (notebook), "drag-failed",
|
|
||||||
G_CALLBACK (gtk_notebook_drag_failed), NULL);
|
|
||||||
|
|
||||||
gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
|
gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
|
context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
|
||||||
@ -3588,8 +3585,7 @@ gtk_notebook_create_window (GtkNotebook *notebook,
|
|||||||
static gboolean
|
static gboolean
|
||||||
gtk_notebook_drag_failed (GtkWidget *widget,
|
gtk_notebook_drag_failed (GtkWidget *widget,
|
||||||
GdkDragContext *context,
|
GdkDragContext *context,
|
||||||
GtkDragResult result,
|
GtkDragResult result)
|
||||||
gpointer data)
|
|
||||||
{
|
{
|
||||||
if (result == GTK_DRAG_RESULT_NO_TARGET)
|
if (result == GTK_DRAG_RESULT_NO_TARGET)
|
||||||
{
|
{
|
||||||
|
@ -2455,7 +2455,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
|
|||||||
g_signal_new (I_("drag-failed"),
|
g_signal_new (I_("drag-failed"),
|
||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
0, _gtk_boolean_handled_accumulator, NULL,
|
G_STRUCT_OFFSET (GtkWidgetClass, drag_failed),
|
||||||
|
_gtk_boolean_handled_accumulator, NULL,
|
||||||
_gtk_marshal_BOOLEAN__OBJECT_ENUM,
|
_gtk_marshal_BOOLEAN__OBJECT_ENUM,
|
||||||
G_TYPE_BOOLEAN, 2,
|
G_TYPE_BOOLEAN, 2,
|
||||||
GDK_TYPE_DRAG_CONTEXT,
|
GDK_TYPE_DRAG_CONTEXT,
|
||||||
|
@ -375,6 +375,9 @@ struct _GtkWidgetClass
|
|||||||
GtkSelectionData *selection_data,
|
GtkSelectionData *selection_data,
|
||||||
guint info,
|
guint info,
|
||||||
guint time_);
|
guint time_);
|
||||||
|
gboolean (* drag_failed) (GtkWidget *widget,
|
||||||
|
GdkDragContext *context,
|
||||||
|
GtkDragResult result);
|
||||||
|
|
||||||
/* Signals used only for keybindings */
|
/* Signals used only for keybindings */
|
||||||
gboolean (* popup_menu) (GtkWidget *widget);
|
gboolean (* popup_menu) (GtkWidget *widget);
|
||||||
|
Loading…
Reference in New Issue
Block a user