Subject: 31.0.50; MacOS: TUINSRemoteViewController log message

From: Gerd Möllmann <[email-masked]>
Date: Sat, 03 Aug 2024 12:33:13 +0200

On macOS 14, Emacs occasionally prints to stderr

  2024-08-03 11:45:26.785586+0200 emacs[97956:1226150] [miscellany] CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them

Some digging on the Internet reveals that this is in the end caused by
an API change in NSView in macOS 14.

  https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14#NSView

  /* Defaults to NO on macOS 14 and later. Defaults to YES on previous releases. Note some classes (like NSClipView) set their own default values differently than NSView itself.
   */
  @property BOOL clipsToBounds API_AVAILABLE(macos(10.9));

Proposed fix for emacs-30 (minus the igc stuff):

1 file changed, 4 insertions(+)
src/nsterm.m | 4 ++++

modified   src/nsterm.m
@@ -8069,6 +8069,10 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
   emacsframe = igc_xalloc_raw_exact (1);
 #else
   emacsframe = xzalloc (sizeof *emacsframe);
+#endif
+#ifdef NS_IMPL_COCOA
+  if (NSAppKitVersionNumber >= NSAppKitVersionNumber14_0)
+    self.clipsToBounds = YES;
 #endif
   windowClosing = NO;
   processingCompose = NO;