diff --git a/application-client/openvidu-ios/OpenViduIOS.xcodeproj/project.xcworkspace/xcuserdata/openvidu.xcuserdatad/UserInterfaceState.xcuserstate b/application-client/openvidu-ios/OpenViduIOS.xcodeproj/project.xcworkspace/xcuserdata/openvidu.xcuserdatad/UserInterfaceState.xcuserstate index 807f2532..4edd4fe8 100644 Binary files a/application-client/openvidu-ios/OpenViduIOS.xcodeproj/project.xcworkspace/xcuserdata/openvidu.xcuserdatad/UserInterfaceState.xcuserstate and b/application-client/openvidu-ios/OpenViduIOS.xcodeproj/project.xcworkspace/xcuserdata/openvidu.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/application-client/openvidu-ios/Shared/Custom.swift b/application-client/openvidu-ios/Shared/Custom.swift index 02328cb2..8ca5340e 100644 --- a/application-client/openvidu-ios/Shared/Custom.swift +++ b/application-client/openvidu-ios/Shared/Custom.swift @@ -65,16 +65,6 @@ struct LKButton: View { } #endif -#if os(macOS) - // Avoid showing focus border around textfield for macOS - extension NSTextField { - override open var focusRingType: NSFocusRingType { - get { .none } - set {} - } - } -#endif - struct LKTextField: View { enum `Type` { case `default` diff --git a/application-client/openvidu-ios/Shared/OpenViduApp.swift b/application-client/openvidu-ios/Shared/OpenViduApp.swift index eb4dbb36..42ecfee6 100644 --- a/application-client/openvidu-ios/Shared/OpenViduApp.swift +++ b/application-client/openvidu-ios/Shared/OpenViduApp.swift @@ -180,9 +180,5 @@ struct OpenViduApp: App { .environmentObject(appCtx) } .handlesExternalEvents(matching: Set(arrayLiteral: "*")) - #if os(macOS) - .windowStyle(.hiddenTitleBar) - .windowToolbarStyle(.unifiedCompact) - #endif } } diff --git a/application-client/openvidu-ios/Shared/Views/ConfigureUrlsView.swift b/application-client/openvidu-ios/Shared/Views/ConfigureUrlsView.swift index 6ece265d..9de9992a 100644 --- a/application-client/openvidu-ios/Shared/Views/ConfigureUrlsView.swift +++ b/application-client/openvidu-ios/Shared/Views/ConfigureUrlsView.swift @@ -74,10 +74,6 @@ struct ConfigureUrlsView: View { .frame(minHeight: geometry.size.height) // Set the content’s min height to the parent } } -#if os(macOS) - .frame(minWidth: 500, minHeight: 500) -#endif - } func isValidURL(_ urlString: String) -> Bool { diff --git a/application-client/openvidu-ios/Shared/Views/ConnectView.swift b/application-client/openvidu-ios/Shared/Views/ConnectView.swift index 9346eac2..c4724608 100644 --- a/application-client/openvidu-ios/Shared/Views/ConnectView.swift +++ b/application-client/openvidu-ios/Shared/Views/ConnectView.swift @@ -84,9 +84,6 @@ struct ConnectView: View { .frame(minHeight: geometry.size.height) // Set the content’s min height to the parent } } - #if os(macOS) - .frame(minWidth: 500, minHeight: 500) - #endif .alert(isPresented: $roomCtx.shouldShowDisconnectReason) { Alert(title: Text("Disconnected"), message: Text("Reason: " + String(describing: roomCtx.latestError))) diff --git a/application-client/openvidu-ios/Shared/Views/RoomView.swift b/application-client/openvidu-ios/Shared/Views/RoomView.swift index 28e52843..fa81dd44 100644 --- a/application-client/openvidu-ios/Shared/Views/RoomView.swift +++ b/application-client/openvidu-ios/Shared/Views/RoomView.swift @@ -18,62 +18,17 @@ import LiveKit import SFSafeSymbols import SwiftUI -#if !os(macOS) let adaptiveMin = 170.0 let toolbarPlacement: ToolbarItemPlacement = .bottomBar -#else -let adaptiveMin = 300.0 -let toolbarPlacement: ToolbarItemPlacement = .primaryAction -#endif + extension CIImage { // helper to create a `CIImage` for both platforms convenience init(named name: String) { -#if !os(macOS) - self.init(cgImage: UIImage(named: name)!.cgImage!) -#else - self.init(data: NSImage(named: name)!.tiffRepresentation!)! -#endif - } -} + self.init(cgImage: UIImage(named: name)!.cgImage!) -#if os(macOS) -// keeps weak reference to NSWindow -class WindowAccess: ObservableObject { - private weak var window: NSWindow? - - deinit { - // reset changed properties - DispatchQueue.main.async { [weak window] in - window?.level = .normal - } - } - - @Published public var pinned: Bool = false { - didSet { - guard oldValue != pinned else { return } - level = pinned ? .floating : .normal - } - } - - private var level: NSWindow.Level { - get { window?.level ?? .normal } - set { - Task { @MainActor in - window?.level = newValue - objectWillChange.send() - } - } - } - - public func set(window: NSWindow?) { - self.window = window - Task { @MainActor in - objectWillChange.send() - } } } -#endif struct RoomView: View { @EnvironmentObject var appCtx: AppContext @@ -81,12 +36,8 @@ struct RoomView: View { @EnvironmentObject var room: Room @State var isCameraPublishingBusy = false - @State var isMicrophonePublishingBusy = false + @State var isMicrophonePublishingBusy = false -#if os(macOS) - @ObservedObject private var windowAccess = WindowAccess() -#endif - func sortedParticipants() -> [Participant] { room.allParticipants.values.sorted { p1, p2 in if p1 is LocalParticipant { return true }