Fixed <rdar://problem/4007262> Seed: Flight tracker scrolling moves to the left
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Feb 2005 00:09:39 +0000 (00:09 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Feb 2005 00:09:39 +0000 (00:09 +0000)
Added SPI for dashboard to disable wheel scrolling of the WebClipView.

        Reviewed by Ken.

        * ChangeLog:
        * WebView.subproj/WebClipView.m:
        (-[WebClipView _focusRingVisibleRect]):
        (-[WebClipView scrollWheel:]):
        * WebView.subproj/WebView.m:
        (-[WebViewPrivate init]):
        (-[WebView drawRect:]):
        (-[WebView _dashboardBehavior:]):
        * WebView.subproj/WebViewInternal.h:
        * WebView.subproj/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8619 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebView.subproj/WebClipView.m
WebKit/WebView.subproj/WebView.m
WebKit/WebView.subproj/WebViewInternal.h
WebKit/WebView.subproj/WebViewPrivate.h

index 81040c56e3103727aca7f641dad32ee123a8a9ea..422fb544ace2a3b5edfa573f61ad7e0092ec0b82 100644 (file)
@@ -1,3 +1,22 @@
+2005-02-17  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/4007262> Seed: Flight tracker scrolling moves to the left
+
+       Added SPI for dashboard to disable wheel scrolling of the WebClipView.
+
+        Reviewed by Ken.
+
+        * ChangeLog:
+        * WebView.subproj/WebClipView.m:
+        (-[WebClipView _focusRingVisibleRect]):
+        (-[WebClipView scrollWheel:]):
+        * WebView.subproj/WebView.m:
+        (-[WebViewPrivate init]):
+        (-[WebView drawRect:]):
+        (-[WebView _dashboardBehavior:]):
+        * WebView.subproj/WebViewInternal.h:
+        * WebView.subproj/WebViewPrivate.h:
+
 === Safari-187 ===
 
 2005-02-17  Vicki Murley <vicki@apple.com>
index 170445ba2b5137ae10a49e380cfe352f9fe72304..971c1b7e0a40d9a0b9f720d9283f51d245e5edf0 100644 (file)
@@ -9,6 +9,9 @@
 #import "WebClipView.h"
 
 #import <WebKit/WebAssertions.h>
+#import <WebKit/WebHTMLView.h>
+#import <WebKit/WebNSViewExtras.h>
+#import <WebKit/WebViewPrivate.h>
 
 // WebClipView's entire reason for existing is to set the clip used by focus ring redrawing.
 // There's no easy way to prevent the focus ring from drawing outside the passed-in clip rectangle
     return rect;
 }
 
+- (void)scrollWheel:(NSEvent *)event
+{
+    NSView *docView = [self documentView];
+    if ([docView respondsToSelector:@selector(_webView)]) {
+       WebView *wv = [docView _webView];
+       if ([wv _dashboardBehavior:WebDashboardBehaviorAllowWheelScrolling]) {
+           [super scrollWheel:event];
+       }
+       return;
+    }
+    [super scrollWheel:event];
+}
+
 @end
index f1273cdce5f75c887b5a6e6550f07ce0aacdca5e..cb61c55621f893878dc34b036310b484af9162d7 100644 (file)
@@ -233,6 +233,7 @@ static BOOL shouldUseFontSmoothing = YES;
     progressNotificationInterval = 0.02;
     progressNotificationTimeInterval = 0.1;
     settings = [[WebCoreSettings alloc] init];
+    dashboardBehaviorAllowWheelScrolling = YES;
 
     return self;
 }
@@ -269,7 +270,7 @@ static BOOL shouldUseFontSmoothing = YES;
 @implementation WebView (WebPrivate)
 
 #ifdef DEBUG_WIDGET_DRAWING
-static bool debugWidget = false;
+static bool debugWidget = true;
 - (void)drawRect:(NSRect)rect
 {
     [[NSColor blueColor] set];
@@ -278,8 +279,7 @@ static bool debugWidget = false;
     NSRect htmlViewRect = [[[[self mainFrame] frameView] documentView] frame];
 
     if (debugWidget) {
-       bool flag = false;
-       while (flag) {
+       while (debugWidget) {
            sleep (1);
        }
     }
@@ -1311,6 +1311,10 @@ static bool debugWidget = false;
             _private->dashboardBehaviorAlwaysAcceptsFirstMouse = flag;
             break;
         }
+        case WebDashboardBehaviorAllowWheelScrolling: {
+            _private->dashboardBehaviorAllowWheelScrolling = flag;
+           break;
+        }
     }
 }
 
@@ -1326,6 +1330,9 @@ static bool debugWidget = false;
         case WebDashboardBehaviorAlwaysAcceptsFirstMouse: {
             return _private->dashboardBehaviorAlwaysAcceptsFirstMouse;
         }
+        case WebDashboardBehaviorAllowWheelScrolling: {
+            return _private->dashboardBehaviorAllowWheelScrolling;
+        }
     }
     return NO;
 }
index d99e1a9acda16c277246e710d4c4819d47a80e07..594f876ed63f04d75d3521a05320d00f542a1898 100644 (file)
@@ -84,6 +84,7 @@
     BOOL dashboardBehaviorAlwaysSendMouseEventsToAllWindows;
     BOOL dashboardBehaviorAlwaysSendActiveNullEventsToPlugIns;
     BOOL dashboardBehaviorAlwaysAcceptsFirstMouse;
+    BOOL dashboardBehaviorAllowWheelScrolling;
     
     BOOL shouldUseFontSmoothing;
     BOOL selectWordBeforeMenuEvent;
index 90cc9359980123f0cf7a75f4343087347f554753..b246e14a4b4e940d83eb2813cb2263e48820a619 100644 (file)
@@ -34,7 +34,8 @@ extern NSString *_WebMainFrameURLKey;
 typedef enum {
        WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows,
        WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns,
-       WebDashboardBehaviorAlwaysAcceptsFirstMouse
+       WebDashboardBehaviorAlwaysAcceptsFirstMouse,
+       WebDashboardBehaviorAllowWheelScrolling
 } WebDashboardBehavior;