Skip to content
Permalink
Browse files
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
patrickangle committed Jun 13, 2022
1 parent 53f736f commit 3b03219cf561b760a4ab7eef592f24bb9d72793f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
@@ -372,6 +372,11 @@ - (IBAction)_popUpButtonAction:(id)sender
[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.
@@ -562,6 +562,11 @@ - (NSWindow *)window
[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()];

0 comments on commit 3b03219

Please sign in to comment.