From cf38989bddd1e3a977a83e9ebc9627c794b13ffc Mon Sep 17 00:00:00 2001 From: "ben%netscape.com" Date: Tue, 5 Jun 2001 02:15:12 +0000 Subject: [PATCH] Fix X-server crash by preventing drags from menus on non-Win32 platforms. r=hyatt, sr=blake, a=asa, bug 79003. --- xpfe/browser/resources/content/navigatorDD.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xpfe/browser/resources/content/navigatorDD.js b/xpfe/browser/resources/content/navigatorDD.js index afb639c08dd3..38b95f80f4cf 100644 --- a/xpfe/browser/resources/content/navigatorDD.js +++ b/xpfe/browser/resources/content/navigatorDD.js @@ -22,12 +22,6 @@ * - Ben Goodger */ -//////////////////////////////////////////////////////////////////////////// -// XXX - WARNING - DRAG AND DROP API CHANGE ALERT - XXX -// This file has been extensively modified in a checkin planned for Mozilla -// 0.8, and the API has been modified. DO NOT MODIFY THIS FILE without -// approval from ben@netscape.com, otherwise your changes will be lost. - var gRDFService = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); @@ -76,6 +70,16 @@ var personalToolbarObserver = { DROP_AFTER: 1, onDragStart: function (aEvent, aXferData, aDragAction) { + // Prevent dragging out of menus on non Win32 platforms. + // a) on Mac drag from menus is generally regarded as being satanic + // b) on Linux, this causes an X-server crash, see bug 79003. + // Since we're not doing D&D into menus properly at this point, it seems + // fair enough to disable it on non-Win32 platforms. There is no hang + // or crash associated with this on Windows, so we'll leave the functionality + // there. + if (navigator.platform != "Win32" && aEvent.target.localName != "button") + return; + var personalToolbar = document.getElementById("PersonalToolbar"); if (aEvent.target == personalToolbar) return;