summaryrefslogtreecommitdiff
path: root/widget
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-01-18 12:32:12 +0100
committerMoonchild <moonchild@palemoon.org>2023-01-18 12:32:12 +0100
commit25ed47347138afa782c02d696e217f64e6037274 (patch)
tree026f9f875314b45d55036366da876709304bfcaa /widget
parent304dfb8da27f8062b51e99034c77d83cddf21053 (diff)
downloaduxp-25ed47347138afa782c02d696e217f64e6037274.tar.gz
[gtk widget] Use text/uri-list for file drag&drop.
Diffstat (limited to 'widget')
-rw-r--r--widget/gtk/nsDragService.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp
index aa5ee2c7ad..4148e5b768 100644
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -793,12 +793,8 @@ nsDragService::GetData(nsITransferable * aTransferable,
// Dragging and dropping from the file manager would cause us
// to parse the source text as a nsIFile URL.
if ( strcmp(flavorStr, kFileMime) == 0 ) {
- gdkFlavor = gdk_atom_intern(kTextMime, FALSE);
+ gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
GetTargetDragData(gdkFlavor);
- if (!mTargetDragData) {
- gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
- GetTargetDragData(gdkFlavor);
- }
if (mTargetDragData) {
const char* text = static_cast<char*>(mTargetDragData);
char16_t* convertedText = nullptr;
@@ -1077,8 +1073,8 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
(strcmp(aDataFlavor, kURLMime) == 0 ||
strcmp(aDataFlavor, kFileMime) == 0)) {
MOZ_LOG(sDragLm, LogLevel::Debug,
- ("good! ( it's text/uri-list and \
- we're checking against text/x-moz-url )\n"));
+ ("good! (it's text/uri-list and \
+ we're checking against text/x-moz-url)\n"));
*_retval = true;
}
// check for automatic _NETSCAPE_URL -> text/x-moz-url mapping
@@ -1087,19 +1083,18 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
(strcmp(name, gMozUrlType) == 0) &&
(strcmp(aDataFlavor, kURLMime) == 0)) {
MOZ_LOG(sDragLm, LogLevel::Debug,
- ("good! ( it's _NETSCAPE_URL and \
- we're checking against text/x-moz-url )\n"));
+ ("good! (it's _NETSCAPE_URL and \
+ we're checking against text/x-moz-url)\n"));
*_retval = true;
}
// check for auto text/plain -> text/unicode mapping
if (!*_retval &&
name &&
(strcmp(name, kTextMime) == 0) &&
- ((strcmp(aDataFlavor, kUnicodeMime) == 0) ||
- (strcmp(aDataFlavor, kFileMime) == 0))) {
+ (strcmp(aDataFlavor, kUnicodeMime) == 0)) {
MOZ_LOG(sDragLm, LogLevel::Debug,
- ("good! ( it's text plain and we're checking \
- against text/unicode or application/x-moz-file)\n"));
+ ("good! (it's text plain and we're checking \
+ against text/unicode)\n"));
*_retval = true;
}
g_free(name);