I write macOS menu app with TextField by SwiftUI on Japanese Input mode. On some conditions, the TextFiled lost focus, no key input, no mouse click. User cannot do anything.
Setup
MacOS Ventura 13.3.1 (a)
Install Japanese Romaji Input source by System Preferences -> Keyboard
Set input mode as "Romaji"
Build test source code
On Xcode 14.3, create new macOS app project "FocusTest" with SwiftUI, Swift.
Replace FocusTestApp.swift with attached code.
Build on Xcode
Steps
Set input mode as "Romaji"
Run FocusTestApp
Click T square icon on top menu
Small windows with globe appear
Click Desktop background area
Click T square icon on top menu
Click PIN
T with PIN textField View appear
That textField lost focus, click inside of textField
Key or click is not accepted.
With US keyboard mode, key input become possible on Step 10. But Focused blue square is missing.
Code of FocusTestApp.swift
import SwiftUI
@main
struct focusTestApp: App {
var body: some Scene {
MenuBarExtra("Test", systemImage: "t.square") {
MainView()
}.menuBarExtraStyle(.window)
}
}
struct MainView: View {
@State private var showingPIN: Bool = false
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Button("PIN") {
print("clicked")
showingPIN = true
}
}
.padding()
.sheet(isPresented: $showingPIN) {
PinView()
}
}
}
struct PinView: View {
@Environment(\.presentationMode) var presentationMode
@State private var pin: String = ""
@FocusState private var pinIsFocused: Bool
var body: some View {
VStack {
Image(systemName: "t.square")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 64.0, height: 64.0)
.foregroundColor(.accentColor)
Text("Enter PIN code")
HStack {
TextField("", text: $pin)
.font(Font.system(size: 28, design: .default))
.frame(width:4*28.0, height:28.0)
.focusable()
.focused($pinIsFocused)
}
.onAppear(){
pinIsFocused = true
}
}
.padding()
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I like to know NullAudio.c is official SDK sample or not.
And the reason of enum and UID is defined in NullAudio.c, not defined in SDK header files.
I try to use kObjectID_Mute_Output_Master, but it defined different values on each 3rd party plugin.
kObjectID_Mute_Output_Master = 10 // NullAudio.c
kObjectID_Mute_Output_Master = 9 // https://github.com/ExistentialAudio/BlackHole
kObjectID_Mute_Output_Master = 6 // https://github.com/q-p/SoundPusher
I can build BlackHole and SoundPusher, these plugin worked.
This enum should be defined SDK header and keep same value on each SDK version.
I like to know why 3rd party defined different value.
If you know the history of NullAudio.c, please let me know.
I have old ScreenCaptureKit sample downloaded on Oct 2022.
That sample worked on Oct 2022. But it does not work on Apr 2024 on Sonoma 14.4.1 M1 MacBook. It only shows black screen.
I also download updated ScreenCaptureKit sample and test it. It works on Sonoma 14.4.1 M1 MacBook. I noticed latest sample have SCContentSharingPicker and other changes.
I have my screen capture application based on old ScreenCaptureKit sample. My app only shows black screen.
Do I have to add SCContentSharingPicker and SCContentSharingPickerObserver on my application for capturing screen on Sonoma?
Old way of screen capture without SCContentSharingPicker is not supported anymore on Sonoma?
I am working on ScreenCaptureKit sample with SCContentSharingPickerObserver.
My Target is SwiftUI based and calling Objective-C class method. I added [MyTarget]-Bridging.h and [MyTarget]-Swift.h
I got compile error of unknown class name SCContentSharingPickerObserver in [MyTarget]-Swift.h. But I do not know how to fix this error since [MyTarget]-Swift.h is Xcode generated file.
I set macOS target is 14.0, swift language ver is 5
Anyone know how to fix this error or waiting for Xcode update?
I made CameraExtension and installed by OSSystemExtensionRequest.
I got success callback. I did uninstall old version of my CameraExtension and install new version of my CameraExtension.
"systemextensionsctl list" command shows "[activated enabled]" on my new version.
But no daemon process with my CameraExtension is not running. I need to reboot OS to start the daemon process. This issue is new at macOS Sonoma 14.5. I did not see this issue on 14.4.x