summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2023-04-18 14:19:19 -0700
committerCorey Berla <corey@berla.me>2023-04-24 14:37:34 -0700
commite1cdc38a10f307797081a686b5b683bb886b9a88 (patch)
tree53d34d4db302854740036a71145da3b2ed685632
parentaa247388d195e386c8d50839ca9b0c2df9f81e1d (diff)
downloadnautilus-wip/corey/tabdnd.tar.gz
window: Get actual preferred action for AdwTabBar dropwip/corey/tabdnd
We are using a workaround to get the preferred action on the AdwTabBar extra drop, by setting data on the page within ::extra-drag-value. This hack doesn't account for the changes in preferred actions using the CTRL/SHIFT modifiers. Use the new adw api which gets the action directly from the GdkDrop.
-rw-r--r--src/nautilus-window.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 0033dcf5d..bd621ebae 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1502,12 +1502,6 @@ extra_drag_value_cb (AdwTabBar *self,
}
}
- /* We set the preferred action on the drop from the results of this function,
- * but since we don't have access to the GtkDropTarget, we can't get the preferred
- * action in ::drop, so let's set it as data on the page. We probably should
- * expose the preferred action within libadwaita.
- */
- g_object_set_data (G_OBJECT (page), "drag-action", GINT_TO_POINTER (action));
return action;
}
@@ -1520,7 +1514,7 @@ extra_drag_drop_cb (AdwTabBar *self,
NautilusWindowSlot *slot = NAUTILUS_WINDOW_SLOT (adw_tab_page_get_child (page));
NautilusFilesView *view = NAUTILUS_FILES_VIEW (nautilus_window_slot_get_current_view (slot));
GFile *target_location = nautilus_window_slot_get_location (slot);
- GdkDragAction action = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (page), "drag-action"));
+ GdkDragAction action = adw_tab_bar_get_extra_drag_preferred_action (self);
return nautilus_dnd_perform_drop (view, value, action, target_location);
}