diff options
Diffstat (limited to 'widget')
-rw-r--r-- | widget/gtk/nsDragService.cpp | 17 | ||||
-rw-r--r-- | widget/gtk/nsDragService.h | 3 |
2 files changed, 12 insertions, 8 deletions
diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index df0965b5e4..0135f97a4e 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -712,7 +712,7 @@ nsDragService::GetNumDropItems(uint32_t* aNumItems) { *aNumItems = 0; return NS_OK; } - GetTargetDragData(gdkFlavor, dragFlavors); + GetTargetDragData(gdkFlavor, dragFlavors, false /* resetTargetData */); } // application/vnd.portal.filetransfer @@ -722,7 +722,7 @@ nsDragService::GetNumDropItems(uint32_t* aNumItems) { *aNumItems = 0; return NS_OK; } - GetTargetDragData(gdkFlavor, dragFlavors); + GetTargetDragData(gdkFlavor, dragFlavors, false /* resetTargetData */); } if (mTargetDragUris) { @@ -875,7 +875,7 @@ nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) { LOGDRAGSERVICE(" file not found, proceed with %s flavor\n", gPortalFile); gdkFlavor = gdk_atom_intern(gPortalFile, FALSE); if (gdkFlavor) { - GetTargetDragData(gdkFlavor, dragFlavors); + GetTargetDragData(gdkFlavor, dragFlavors, false /* resetTargetData */); GetReachableFileFromUriList(mTargetDragUris.get(), aItemIndex, file); } } @@ -886,7 +886,7 @@ nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) { gPortalFileTransfer); gdkFlavor = gdk_atom_intern(gPortalFileTransfer, FALSE); if (gdkFlavor) { - GetTargetDragData(gdkFlavor, dragFlavors); + GetTargetDragData(gdkFlavor, dragFlavors, false /* resetTargetData */); GetReachableFileFromUriList(mTargetDragUris.get(), aItemIndex, file); } } @@ -899,7 +899,7 @@ nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) { gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE); if (gdkFlavor) { - GetTargetDragData(gdkFlavor, dragFlavors); + GetTargetDragData(gdkFlavor, dragFlavors, false /* resetTargetData */); GetReachableFileFromUriList(mTargetDragUris.get(), aItemIndex, file); } } @@ -1290,13 +1290,16 @@ bool nsDragService::IsTargetContextList(void) { // DispatchMotionEvents(). // Can lead to another round of drag_motion events. void nsDragService::GetTargetDragData(GdkAtom aFlavor, - nsTArray<nsCString>& aDropFlavors) { + nsTArray<nsCString>& aDropFlavors, + bool aResetTargetData) { LOGDRAGSERVICE("nsDragService::GetTargetDragData(%p) '%s'\n", mTargetDragContext.get(), GUniquePtr<gchar>(gdk_atom_name(aFlavor)).get()); // reset our target data areas - TargetResetData(); + if (aResetTargetData) { + TargetResetData(); + } GUniquePtr<gchar> name(gdk_atom_name(aFlavor)); nsDependentCString flavor(name.get()); diff --git a/widget/gtk/nsDragService.h b/widget/gtk/nsDragService.h index 8a45b7b8ed..bb5da26cd4 100644 --- a/widget/gtk/nsDragService.h +++ b/widget/gtk/nsDragService.h @@ -207,7 +207,8 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { bool IsTargetContextList(void); // this will get the native data from the last target given a // specific flavor - void GetTargetDragData(GdkAtom aFlavor, nsTArray<nsCString>& aDropFlavors); + void GetTargetDragData(GdkAtom aFlavor, nsTArray<nsCString>& aDropFlavors, + bool aResetTargetData = true); // this will reset all of the target vars void TargetResetData(void); // Ensure our data cache belongs to aDragContext and clear the cache if |