Skip to content

Commit 3736fb0

Browse files
committed
macOS: Fix ViewBridge log warning
1 parent 84c7acf commit 3736fb0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/glfm_apple.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,12 @@ - (void)dealloc {
13311331
}
13321332
[NSEvent removeMonitor:self.keyEventMonitor];
13331333
self.keyEventMonitor = nil;
1334-
[self.textInputContext deactivate];
1334+
if (@available(macOS 15, *)) {
1335+
// Do nothing
1336+
} else {
1337+
// See note on [self.textInputContext activate] above.
1338+
[self.textInputContext deactivate];
1339+
}
13351340
self.textInputContext = nil;
13361341
#endif
13371342
#if GLFM_INCLUDE_METAL
@@ -1415,7 +1420,14 @@ - (void)loadView {
14151420
if ([glfmView conformsToProtocol:@protocol(NSTextInputClient)]) {
14161421
self.textInputContext = GLFM_AUTORELEASE([[NSTextInputContext alloc]
14171422
initWithClient:(id<NSTextInputClient>)glfmView]);
1418-
[self.textInputContext activate];
1423+
// Invoking [self.textInputContext activate] causes a log error:
1424+
// "ViewBridge to RemoteViewService Terminated: Error Domain=com.apple.ViewBridge".
1425+
// If macOS 15, it appears unnecessary.
1426+
if (@available(macOS 15, *)) {
1427+
// Do nothing
1428+
} else {
1429+
[self.textInputContext activate];
1430+
}
14191431
}
14201432

14211433
#endif

0 commit comments

Comments
 (0)