-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
|
What macOS version is it? Have you tried reproducing this in a new macOS app project with vanilla SwiftUI using just a window-based |
Beta Was this translation helpful? Give feedback.
-
|
I'm in macOS 14.0, Xcode target set to 14.0. Yes, a brand new project using SwiftUI, window-based MenuBarExtra and SettingsLink. It could be a SwiftUI issue. If this is the case, is it still possible to capture the Settings window using |
Beta Was this translation helpful? Give feedback.
-
|
SettingsAccess is really just designed as a wrapper for Apple's I imagine you could shoehorn that code into the post-action closure of the custom |
Beta Was this translation helpful? Give feedback.
-
|
Still fighting with it. I've tried multiple code alternatives in the post-action closure, but none worked out. I had some partial success, for example I was able to hide the minimise and maximise buttons of the Settings window, but no luck when trying to make it Then I came back to the original macControlCenterUI Demo app, and I realised that it does what I wanted. If I open the Settings from a fullscreen desktop, it leaves the fullscreen desktop and opens it in the main desktop setting the focus on it. But creating a dummy sample project from scratch using both packages and doing same steps as macControlCenterUI Demo app does, I got different results. If I open the Settings from a fullscreen desktop, it doesn't leave the fullscreen desktop and opens it in the main desktop, without setting the focus on it. Definitively I'm missing something but I can't find it. import SwiftUI
import MenuBarExtraAccess
import SettingsAccess
@main
struct MenuBarPackagesApp: App {
@State var isMenuPresented: Bool = false
var body: some Scene {
Settings {
SettingsView()
}
MenuBarExtra("MyApp Menu", systemImage: "folder") {
MyMenu(isMenuPresented: $isMenuPresented)
.openSettingsAccess()
}
.menuBarExtraStyle(.window)
.menuBarExtraAccess(isPresented: $isMenuPresented) { statusItem in
// access status item or store it in a @State var
}
}
}
struct SettingsView: View {
var body: some View {
Text("Hello")
.frame(width: 300, height: 300)
}
}
struct MyMenu: View {
@Environment(\.openSettings) var openSettings
@Binding var isMenuPresented: Bool
var body: some View {
Button("Open settings") {
isMenuPresented = false
try? openSettings()
}
.frame(width: 200, height: 200)
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Oh man, I found it. I wasn't setting the Target property Doing that in fact opens the Settings window in the current fullscreen desktop. Whatever, that's good to me! Let me thank you for your excellent work on these two packages, Steffan. |
Beta Was this translation helpful? Give feedback.

Oh man, I found it.
I wasn't setting the Target property
"Application is agent (UIElement)"=YES. For some reason that had a weird effect.Doing that in fact opens the Settings window in the current fullscreen desktop. Whatever, that's good to me!
Let me thank you for your excellent work on these two packages, Steffan.