2011-02-23 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 21:08:35 +0000 (21:08 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 21:08:35 +0000 (21:08 +0000)
        Reviewed by Dan Bernstein.

        Web Inspector toolbar looks bad in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=55076
        <rdar://problem/8866258>

        * UIProcess/API/mac/WKView.mm:
        (-[WKView mouseDownCanMoveWindow]):
        Return NO from mouseDownCanMoveWindow to prevent drags in the (now transparent) inspector WKView
        from dragging the window around.

        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
        Call [WKView setDrawsBackground:NO].

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm

index 78f7e16..843e3f0 100644 (file)
@@ -1,3 +1,20 @@
+2011-02-23  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Web Inspector toolbar looks bad in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=55076
+        <rdar://problem/8866258>
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView mouseDownCanMoveWindow]):
+        Return NO from mouseDownCanMoveWindow to prevent drags in the (now transparent) inspector WKView
+        from dragging the window around.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        Call [WKView setDrawsBackground:NO].
+
 2011-02-23  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Anders Carlsson.
index 71592cf..67fab36 100644 (file)
@@ -1512,6 +1512,13 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
     return _data->_page->drawsBackground();
 }
 
+- (BOOL)mouseDownCanMoveWindow
+{
+    // -[NSView mouseDownCanMoveWindow] returns YES when the NSView is transparent,
+    // but we don't want a drag in the NSView to move the window, even if it's transparent.
+    return NO;
+}
+
 - (void)viewDidHide
 {
     _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
index c68f04d..67d184c 100644 (file)
@@ -82,6 +82,8 @@ WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
     m_inspectorView.adoptNS([[WKView alloc] initWithFrame:NSZeroRect contextRef:toAPI(page()->context()) pageGroupRef:toAPI(inspectorPageGroup())]);
     ASSERT(m_inspectorView);
 
+    [m_inspectorView.get() setDrawsBackground:NO];
+
     return toImpl(m_inspectorView.get().pageRef);
 }