FIx for drag and drop without CPDOMWindowBridge.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-07-27 12:06:07 -07:00
parent 756885fd53
commit d2b1df88e8
3 changed files with 24 additions and 5 deletions
+9 -2
View File
@@ -26,6 +26,7 @@
@import <AppKit/CPImageView.j>
#import "CoreGraphics/CGGeometry.h"
#import "Platform/Platform.h"
#define DRAGGING_WINDOW(anObject) ([anObject isKindOfClass:[CPWindow class]] ? anObject : [anObject window])
@@ -241,14 +242,20 @@ var CPDragServerUpdateDragging = function(anEvent)
- (void)dragView:(CPView)aView fromWindow:(CPWindow)aWindow at:(CGPoint)viewLocation offset:(CGSize)mouseOffset event:(CPEvent)anEvent pasteboard:(CPPasteboard)aPasteboard source:(id)aSourceObject slideBack:(BOOL)slideBack
{
var eventLocation = [anEvent locationInWindow];
CPDragServerView = aView;
CPDragServerSource = aSourceObject;
CPDragServerWindow = aWindow;
CPDragServerOffset = CPPointMake(eventLocation.x - viewLocation.x, eventLocation.y - viewLocation.y);
CPDragServerPasteboard = [CPPasteboard pasteboardWithName:CPDragPboard];//aPasteboard;
[_dragWindow setFrameSize:CGSizeMakeCopy([[CPDOMWindowBridge sharedDOMWindowBridge] frame].size)];
#if PLATFORM(BROWSER)
var platformWindow = [aWindow platformWindow];
[_dragWindow setPlatformWindow:platformWindow];
[_dragWindow setFrameSize:[platformWindow contentBounds]];
#endif
[_dragWindow orderFront:self];
[aView setFrameOrigin:viewLocation];
+12 -3
View File
@@ -395,6 +395,17 @@ CPTexturedBackgroundWindowMask
return self;
}
- (CPPlatformWindow)platformWindow
{
return _platformWindow;
}
- (void)setPlatformWindow:(CPPlatformWindow)aPlatformWindow
{
// FIXME: already visible.
_platformWindow = aPlatformWindow;
}
/*!
@ignore
*/
@@ -626,9 +637,7 @@ CPTexturedBackgroundWindowMask
*/
- (void)orderFront:(id)aSender
{
if (![_platformWindow isVisible])
[_platformWindow orderFront:self];
[_platformWindow orderFront:self];
[_platformWindow order:CPWindowAbove window:self relativeTo:nil];
}
+3
View File
@@ -254,6 +254,9 @@ var CTRL_KEY_CODE = 17;
theDocument.addEventListener("touchmove", touchEventCallback, NO);
theDocument.addEventListener("touchcancel", touchEventCallback, NO);
_DOMWindow.addEventListener("DOMMouseScroll", scrollEventCallback, NO);
_DOMWindow.addEventListener("mousewheel", scrollEventCallback, NO);
_DOMWindow.addEventListener("resize", resizeEventCallback, NO);
_DOMWindow.addEventListener("beforeunload", function()