[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:42:56 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 52565c691bff95f6f2cb6c2dac3b66e946d100fd
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri May 28 19:41:48 2004 +0000
Fixed: <rdar://problem/3672129>: (selection deselects when clicking editable WebView in background window)
Fixed this problem by using NSTextView's approach of only allowing dragging on first mouse down.
Reviewed by john.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView acceptsFirstMouse:]): store the first mouse down
(-[WebHTMLView mouseDown:]): Don't tell WebCore about the first mouse down event since only dragging can occur on the first mouse down.
(-[WebHTMLView mouseDragged:]): Don't tell WebCore about the drags that occur after the first mouse down since only dragging can occur after the first mouse down.
* WebView.subproj/WebHTMLViewInternal.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1f4c09c..9d3abca 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2004-05-28 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: <rdar://problem/3672129>: (selection deselects when clicking editable WebView in background window)
+
+ Fixed this problem by using NSTextView's approach of only allowing dragging on first mouse down.
+
+ Reviewed by john.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView acceptsFirstMouse:]): store the first mouse down
+ (-[WebHTMLView mouseDown:]): Don't tell WebCore about the first mouse down event since only dragging can occur on the first mouse down.
+ (-[WebHTMLView mouseDragged:]): Don't tell WebCore about the drags that occur after the first mouse down since only dragging can occur after the first mouse down.
+ * WebView.subproj/WebHTMLViewInternal.h:
+
2004-05-28 Darin Adler <darin at apple.com>
* WebView.subproj/WebView.m: At Ken's suggestion, for better efficiency and safety,
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 1db1bfb..e21952c 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -1593,6 +1593,8 @@ static WebHTMLView *lastHitView = nil;
- (BOOL)acceptsFirstMouse:(NSEvent *)event
{
+ // We don't retain this because we never dispatch to it; we only check its value.
+ _private->firstMouseDownEvent = event;
return [self _isSelectionEvent:event];
}
@@ -1602,7 +1604,7 @@ static WebHTMLView *lastHitView = nil;
}
- (void)mouseDown:(NSEvent *)event
-{
+{
// If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here.
// We don't want to pass them along to KHTML a second time.
if ([event modifierFlags] & NSControlKeyMask) {
@@ -1618,9 +1620,12 @@ static WebHTMLView *lastHitView = nil;
// Don't do any mouseover while the mouse is down.
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_updateMouseoverWithFakeEvent) object:nil];
- // Let KHTML get a chance to deal with the event. This will call back to us
- // to start the autoscroll timer if appropriate.
- [[self _bridge] mouseDown:event];
+ // Don't tell WebCore about the first mouse down event since only dragging can occur on the first mouse down.
+ if (_private->firstMouseDownEvent != event) {
+ // Let KHTML get a chance to deal with the event. This will call back to us
+ // to start the autoscroll timer if appropriate.
+ [[self _bridge] mouseDown:event];
+ }
}
- (void)dragImage:(NSImage *)dragImage
@@ -1644,7 +1649,13 @@ static WebHTMLView *lastHitView = nil;
- (void)mouseDragged:(NSEvent *)event
{
- if (!_private->ignoringMouseDraggedEvents) {
+ // If this drag started from a mouse down in an inactive window, we only allow it to drag out an existing selection, so don't tell WebCore about it.
+ if (_private->mouseDownEvent == _private->firstMouseDownEvent) {
+ // Handle the drag directly instead of getting callbacks from WebCore.
+ if ([self _mayStartDragWithMouseDragged:event]) {
+ [self _handleMouseDragged:event];
+ }
+ } else if (!_private->ignoringMouseDraggedEvents) {
[[self _bridge] mouseDragged:event];
}
}
diff --git a/WebKit/WebView.subproj/WebHTMLViewInternal.h b/WebKit/WebView.subproj/WebHTMLViewInternal.h
index 9c473e6..0212455 100644
--- a/WebKit/WebView.subproj/WebHTMLViewInternal.h
+++ b/WebKit/WebView.subproj/WebHTMLViewInternal.h
@@ -19,6 +19,7 @@
BOOL subviewsSetAside;
NSEvent *mouseDownEvent;
+ NSEvent *firstMouseDownEvent;
NSURL *draggingImageURL;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list