summaryrefslogtreecommitdiffstats
path: root/widget/gtk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:53:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:53:15 +0000
commit50e4c49ba64ce680143c83b142ae5a7ec30fde54 (patch)
tree269a97c1e612c69c97e0a622db091ba5392965c9 /widget/gtk
parentAdding debian version 125.0.2-1. (diff)
downloadfirefox-50e4c49ba64ce680143c83b142ae5a7ec30fde54.tar.xz
firefox-50e4c49ba64ce680143c83b142ae5a7ec30fde54.zip
Merging upstream version 125.0.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/gtk')
-rw-r--r--widget/gtk/nsDragService.cpp17
-rw-r--r--widget/gtk/nsDragService.h3
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