--- widget/src/gtk2/nsDragService.cpp	2005-03-16 22:43:19.000000000 +0530
+++ widget/src/gtk2/nsDragService.cpp	2005-10-08 09:55:54.000000000 +0530
@@ -309,6 +309,51 @@ nsDragService::GetNumDropItems(PRUint32 
 }
 
 
+static bool IsDesktopFile(const char *fileName)
+{
+    if(strncasecmp("file://",fileName,7)==0 && 
+        strncasecmp(".desktop",&fileName[strlen(fileName)-10],8) == 0)
+    {
+        return true;
+    }
+    return false;
+}
+static char *GetURLFromDesktopFile(const char *data)
+{
+    FILE *fp;
+    char *lineInfo = NULL;
+    size_t lineLen;
+    char *fileName;
+
+    fileName=(char *)malloc(strlen(data));
+    if(fileName==NULL) 
+        return NULL;
+
+    strcpy(fileName,data);
+    fileName[strlen(data)-2]='\0';
+
+    fp = fopen(fileName,"rt");
+    if(fp == NULL)
+        return NULL;
+
+    while(getline(&lineInfo,&lineLen,fp)!=-1)
+    {
+        if(strncasecmp("URL=",lineInfo,4)==0)
+        {
+            fclose(fp);
+            free(fileName);
+            return lineInfo;
+        }
+
+        free(lineInfo);
+        lineInfo = NULL;
+    }
+    free(fileName);
+    fclose(fp);
+	return NULL;
+}
+
+
 NS_IMETHODIMP
 nsDragService::GetData(nsITransferable * aTransferable,
                        PRUint32 aItemIndex)
@@ -462,6 +507,20 @@ nsDragService::GetData(nsITransferable *
                                            &convertedText, &convertedTextLen);
 
                         if ( convertedText ) {
+                            if(IsDesktopFile(data))
+                            {
+                            	char *desktop_url;
+	
+                            	desktop_url = GetURLFromDesktopFile(&data[7]);
+                            	if(desktop_url != NULL)
+                                {
+                            		nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode(
+                                        &desktop_url[4], strlen(desktop_url)-4, 
+                                        &convertedText,&convertedTextLen);
+                                    free( desktop_url );
+                                }
+                            }
+
                             PR_LOG(sDragLm, PR_LOG_DEBUG,
                                    ("successfully converted \
                                    _NETSCAPE_URL to unicode.\n"));
