[gtk/dnd-gestures-2: 123/175] notebook: Stop using gtk_drag_get_source



commit 30d9ae77146b00684f7492b215c65870542de65d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 6 20:02:33 2020 -0500

    notebook: Stop using gtk_drag_get_source

 gtk/gtknotebook.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index f9af4668df..04dfc677df 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2901,6 +2901,8 @@ gtk_notebook_motion (GtkEventController *controller,
       priv->operation = DRAG_OPERATION_DETACH;
       tab_drag_end (notebook, priv->cur_page);
 
+      g_object_set_data (G_OBJECT (drag), "gtk-notebook-drag-origin", notebook);
+
       g_object_unref (drag);
 
       return;
@@ -3229,8 +3231,7 @@ gtk_notebook_drag_motion (GtkDropTarget *dest,
         }
       else
         {
-          GtkDragSource *drag_source = gtk_drag_get_source (drag);
-          GtkNotebook *source = GTK_NOTEBOOK (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER 
(drag_source)));
+          GtkNotebook *source = GTK_NOTEBOOK (g_object_get_data (G_OBJECT (drag), 
"gtk-notebook-drag-origin"));
 
           g_assert (source->priv->cur_page != NULL);
           source_child = source->priv->cur_page->child;
@@ -7092,13 +7093,11 @@ gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
  *                         gpointer          user_data)
  *  {
  *    GtkDrag *drag;
- *    GtkDragSource *source;
  *    GtkWidget *notebook;
  *    GtkWidget **child;
  *
  *    drag = gtk_drop_get_drag (drop);
- *    source = gtk_drag_get_source (drag);
- *    notebook = gtk_event_controller_get_widge (GTK_EVENT_CONTROLLER (source));
+ *    notebook = g_object_get_data (drag, "gtk-notebook-drag-origin");
  *    child = (void*) gtk_selection_data_get_data (data);
  *
  *    // process_widget (*child);


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