Title: [295502] trunk/Source
Revision
295502
Author
pan...@apple.com
Date
2022-06-13 14:30:25 -0700 (Mon, 13 Jun 2022)

Log Message

Web Inspector: [Cocoa] Web Inspector windows open in separate window collection instead of on current stage when using Stage Manager
https://bugs.webkit.org/show_bug.cgi?id=241521
rdar://91964707

Reviewed by Devin Rousso.

For Stage Manager, the Web Inspector window should appear in the same workspace as the active Safari window. Currently
the best way to accomplish this without negatively impacting our fullscreen behavior is to appear as if we are a
preferences window with a toolbar and NSWindowToolbarStylePreference. By hiding the toolbar, there is no visual or
functional change to Web Inspector, and we now get classified as an auxiliary window only in Stage Manager.

* Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::createFrontendWindow):
* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController window]):

Canonical link: https://commits.webkit.org/251507@main

Modified Paths

Diff

Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm (295501 => 295502)


--- trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-06-13 20:52:26 UTC (rev 295501)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-06-13 21:30:25 UTC (rev 295502)
@@ -372,6 +372,11 @@
     [window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
     [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
 
+    // FIXME: <rdar://94829409> Replace Stage Manager auxiliary window workaround.
+    [window setToolbar:[NSToolbar new]];
+    [[window toolbar] setVisible:NO];
+    [window setToolbarStyle:NSWindowToolbarStylePreference];
+
     [window setTitlebarAppearsTransparent:YES];
 
     // Center the window if the saved frame was empty.

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm (295501 => 295502)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2022-06-13 20:52:26 UTC (rev 295501)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2022-06-13 21:30:25 UTC (rev 295502)
@@ -562,6 +562,11 @@
     [window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
     [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
 
+    // FIXME: <rdar://94829409> Replace Stage Manager auxiliary window workaround.
+    [window setToolbar:[NSToolbar new]];
+    [[window toolbar] setVisible:NO];
+    [window setToolbarStyle:NSWindowToolbarStylePreference];
+    
     [window setTitlebarAppearsTransparent:YES];
 
     [self setWindow:window.get()];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to