I want to create a window that's main and on the right side, I want to have another window but this should not have the controls to close as the main window has in the bottom. Is this possible? If the user drags the main window, the side window should follow it maintaining it's position as to the right of the main window.
I tried to create separate views for main and side windows. Tried doing this but the side window didn't appear.
import SwiftUI
@main
struct App: App {
var appState = AppState()
var body: some Scene {
WindowGroup {
let feedViewModel = FeedViewModel(appState: appState)
ContentView(feedViewModel: feedViewModel)
.environmentObject(appState)
} // Main Window
WindowGroup {
VideoListView()
} // Side Window
}
}

From your description, the easiest way to achieve what you want is to apply a glass background to two separate views and disable the default glass background of the window. This can be done by first setting the
windowStyleto.plain. Then for the separate panes adding the.glassBackgroundEffect()view modifier. For example:Will modify the default VisionOS template to have one window but with two separate glass views. Like so:
Another option might be to use a
.ornamentview modifier to add a view outside of the window but it will be more difficult to position that view in-line with the window