Title: [185672] trunk/Source/WebKit2
Revision
185672
Author
[email protected]
Date
2015-06-17 14:38:24 -0700 (Wed, 17 Jun 2015)

Log Message

Web Inspector: Improve Full Screen support for Web Inspector windows
https://bugs.webkit.org/show_bug.cgi?id=146036

Patch by Joseph Pecoraro <[email protected]> on 2015-06-17
Reviewed by Timothy Hatcher.

* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
(-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
(WebKit::WebInspectorProxy::platformCanAttach):
(WebKit::WebInspectorProxy::windowFullScreenDidChange):
When entering / leaving full screen update attach availability to
potentially show / hide the frontend's docking buttons.

(WebKit::WebInspectorProxy::createInspectorWindow):
Allow a Web Inspector window to be a full screen auxillary window,
so that if the application with a WebView opens a detached inspector
window it can be shown on the same desktop as the full screen app.
Also, reduce the minimum window size requirements for full screen tiling.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185671 => 185672)


--- trunk/Source/WebKit2/ChangeLog	2015-06-17 21:34:22 UTC (rev 185671)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-17 21:38:24 UTC (rev 185672)
@@ -1,3 +1,25 @@
+2015-06-17  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Improve Full Screen support for Web Inspector windows
+        https://bugs.webkit.org/show_bug.cgi?id=146036
+
+        Reviewed by Timothy Hatcher.
+
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
+        (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
+        (WebKit::WebInspectorProxy::platformCanAttach):
+        (WebKit::WebInspectorProxy::windowFullScreenDidChange):
+        When entering / leaving full screen update attach availability to
+        potentially show / hide the frontend's docking buttons.
+
+        (WebKit::WebInspectorProxy::createInspectorWindow):
+        Allow a Web Inspector window to be a full screen auxillary window,
+        so that if the application with a WebView opens a detached inspector
+        window it can be shown on the same desktop as the full screen app.
+        Also, reduce the minimum window size requirements for full screen tiling.
+
 2015-06-17  Tim Horton  <[email protected]>
 
         Safari tabs still have shrunken content after coming out of fullscreen

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (185671 => 185672)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2015-06-17 21:34:22 UTC (rev 185671)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2015-06-17 21:38:24 UTC (rev 185672)
@@ -101,6 +101,7 @@
     void updateInspectorWindowTitle() const;
     void inspectedViewFrameDidChange(CGFloat = 0);
     void windowFrameDidChange();
+    void windowFullScreenDidChange();
     NSWindow* inspectorWindow() const { return m_inspectorWindow.get(); }
 
     void setInspectorWindowFrame(WKRect&);

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (185671 => 185672)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2015-06-17 21:34:22 UTC (rev 185671)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2015-06-17 21:38:24 UTC (rev 185672)
@@ -141,6 +141,16 @@
     static_cast<WebInspectorProxy*>(_inspectorProxy)->close();
 }
 
+- (void)windowDidEnterFullScreen:(NSNotification *)notification
+{
+    static_cast<WebInspectorProxy*>(_inspectorProxy)->windowFullScreenDidChange();
+}
+
+- (void)windowDidExitFullScreen:(NSNotification *)notification
+{
+    static_cast<WebInspectorProxy*>(_inspectorProxy)->windowFullScreenDidChange();
+}
+
 - (void)ignoreNextInspectedViewFrameDidChange
 {
     _ignoreNextInspectedViewFrameDidChange = YES;
@@ -304,7 +314,15 @@
     [window setDelegate:m_inspectorProxyObjCAdapter.get()];
     [window setMinSize:NSMakeSize(minimumWindowWidth, minimumWindowHeight)];
     [window setReleasedWhenClosed:NO];
+    [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAuxiliary)];
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
+    CGFloat approximatelyHalfScreenSize = (window.screen.frame.size.width / 2) - 4;
+    CGFloat minimumFullScreenWidth = std::max<CGFloat>(636, approximatelyHalfScreenSize);
+    [window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
+    [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
+#endif
+
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     window.titlebarAppearsTransparent = YES;
 #else
@@ -463,6 +481,9 @@
 
 bool WebInspectorProxy::platformCanAttach(bool webProcessCanAttach)
 {
+    if ([m_inspectorWindow styleMask] & NSFullScreenWindowMask)
+        return false;
+
     NSView *inspectedView = inspectedPage()->wkView()._inspectorAttachmentView;
     if ([inspectedView isKindOfClass:[WKView class]])
         return webProcessCanAttach;
@@ -635,13 +656,25 @@
     inspectedPage()->pageGroup().preferences().setInspectorWindowFrame(frameString);
 }
 
+void WebInspectorProxy::windowFullScreenDidChange()
+{
+    ASSERT(!m_isAttached);
+    ASSERT(m_isVisible);
+    ASSERT(m_inspectorWindow);
+
+    if (m_isAttached || !m_isVisible || !m_inspectorWindow)
+        return;
+
+    attachAvailabilityChanged(platformCanAttach(canAttach()));    
+}
+
 void WebInspectorProxy::inspectedViewFrameDidChange(CGFloat currentDimension)
 {
     if (!m_isVisible)
         return;
 
     if (!m_isAttached) {
-        // Check if the attach avaibility changed. We need to do this here in case
+        // Check if the attach availability changed. We need to do this here in case
         // the attachment view is not the WKView.
         attachAvailabilityChanged(platformCanAttach(canAttach()));
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to