зеркало из https://github.com/mozilla/pjs.git
fix "can't drag and drop buttons when customizing toolbars", patch by Stan Shebs. b=358446 r=josh sr=pav
This commit is contained in:
Родитель
03562678cc
Коммит
a156f99f1d
|
@ -1819,6 +1819,7 @@ NSEvent* globalDragEvent = nil;
|
||||||
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
|
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
|
||||||
NSStringPboardType,
|
NSStringPboardType,
|
||||||
NSURLPboardType,
|
NSURLPboardType,
|
||||||
|
kWildcardPboardType,
|
||||||
nil]];
|
nil]];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
|
|
||||||
#include <Cocoa/Cocoa.h>
|
#include <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
extern NSString* const kWildcardPboardType;
|
||||||
|
|
||||||
class nsILocalFile;
|
class nsILocalFile;
|
||||||
class nsIDOMDragEvent;
|
class nsIDOMDragEvent;
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,8 @@ extern NSPasteboard* globalDragPboard;
|
||||||
extern NSView* globalDragView;
|
extern NSView* globalDragView;
|
||||||
extern NSEvent* globalDragEvent;
|
extern NSEvent* globalDragEvent;
|
||||||
|
|
||||||
|
NSString* const kWildcardPboardType = @"MozillaWildcard";
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(nsDragService, nsBaseDragService)
|
NS_IMPL_ADDREF_INHERITED(nsDragService, nsBaseDragService)
|
||||||
NS_IMPL_RELEASE_INHERITED(nsDragService, nsBaseDragService)
|
NS_IMPL_RELEASE_INHERITED(nsDragService, nsBaseDragService)
|
||||||
NS_IMPL_QUERY_INTERFACE2(nsDragService, nsIDragService, nsIDragSession)
|
NS_IMPL_QUERY_INTERFACE2(nsDragService, nsIDragService, nsIDragSession)
|
||||||
|
@ -224,8 +226,17 @@ static nsresult SetUpDragClipboard(nsISupportsArray* aTransferableArray)
|
||||||
id currentValue = [pasteboardOutputDict valueForKey:currentKey];
|
id currentValue = [pasteboardOutputDict valueForKey:currentKey];
|
||||||
if (currentKey == NSStringPboardType)
|
if (currentKey == NSStringPboardType)
|
||||||
[generalPBoard setString:currentValue forType:currentKey];
|
[generalPBoard setString:currentValue forType:currentKey];
|
||||||
else
|
else {
|
||||||
[generalPBoard setData:currentValue forType:currentKey];
|
[generalPBoard setData:currentValue forType:currentKey];
|
||||||
|
// Record miscellaneous types of data a second time, under a
|
||||||
|
// generic type that is always registered with Cocoa as
|
||||||
|
// draggable. This allows types dynamically synthesized from
|
||||||
|
// JS to work; if in the future several different types of
|
||||||
|
// drag data need to be distinguished, it will be the
|
||||||
|
// responsibility of higher-level drag code to detect the
|
||||||
|
// situation (which it would normally have to do anyway.)
|
||||||
|
[generalPBoard setData:nil forType:kWildcardPboardType];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче