Skip to content

Commit c0b7363

Browse files
committed
Web Inspector: Undocked window should remain in the same window set as the inspected content's window when using Stage Manager
https://bugs.webkit.org/show_bug.cgi?id=250218 rdar://94829409 Reviewed by Wenson Hsieh. Adopt proper API for making a window an "auxiliary" window, instead of the previous workaround to get the behavior. * Source/WTF/wtf/PlatformHave.h: * Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: (WebKit::WebInspectorUIProxy::createFrontendWindow): * Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]): Canonical link: https://commits.webkit.org/258672@main
1 parent c645845 commit c0b7363

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Source/WTF/wtf/PlatformHave.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,3 +1400,7 @@
14001400
#if (PLATFORM(IOS) || PLATFORM(WATCHOS) || PLATFORM(APPLETV))
14011401
#define HAVE_MACH_BOOTSTRAP_EXTENSION 1
14021402
#endif
1403+
1404+
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000)
1405+
#define HAVE_STAGE_MANAGER_NS_WINDOW_COLLECTION_BEHAVIORS 1
1406+
#endif

Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,9 @@ - (IBAction)_popUpButtonAction:(id)sender
372372
[window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
373373
[window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
374374

375-
// FIXME: <rdar://94829409> Replace Stage Manager auxiliary window workaround.
376-
[window setToolbar:[NSToolbar new]];
377-
[[window toolbar] setVisible:NO];
378-
[window setToolbarStyle:NSWindowToolbarStylePreference];
375+
#if HAVE(STAGE_MANAGER_NS_WINDOW_COLLECTION_BEHAVIORS)
376+
[window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorAuxiliary)];
377+
#endif
379378

380379
[window setTitlebarAppearsTransparent:YES];
381380

Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,9 @@ - (NSWindow *)window
558558
[window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
559559
[window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
560560

561-
// FIXME: <rdar://94829409> Replace Stage Manager auxiliary window workaround.
562-
[window setToolbar:[NSToolbar new]];
563-
[[window toolbar] setVisible:NO];
564-
[window setToolbarStyle:NSWindowToolbarStylePreference];
561+
#if HAVE(STAGE_MANAGER_NS_WINDOW_COLLECTION_BEHAVIORS)
562+
[window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorAuxiliary)];
563+
#endif
565564

566565
[window setTitlebarAppearsTransparent:YES];
567566

0 commit comments

Comments
 (0)