1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

Fix bug#56153

* src/nsterm.m (get_keysym_name)
(ns_draw_glyphless_glyph_string_foreground): Fix new Mac OS
deprecations.

([EmacsApp terminate:]): Use kbd_buffer_store_event instead
of emacs_event.  (bug#56153)
([EmacsView windowDidChangeBackingProperties:]): Fix new Mac
OS deprecation.
This commit is contained in:
Po Lu 2022-10-14 19:04:44 +08:00
parent 6ea69fc734
commit 271791b55b

View File

@ -2479,7 +2479,7 @@ Hide the window (X11 semantics)
{
static char value[16];
NSTRACE ("get_keysym_name");
sprintf (value, "%d", keysym);
snprintf (value, 16, "%d", keysym);
return value;
}
@ -4263,7 +4263,7 @@ Function modeled after x_draw_glyph_string_box ().
{
unsigned int ch = glyph->u.glyphless.ch;
eassume (ch <= MAX_CHAR);
sprintf (buf, "%0*X", ch < 0x10000 ? 4 : 6, ch);
snprintf (buf, 7, "%0*X", ch < 0x10000 ? 4 : 6, ch);
str = buf;
}
@ -6116,17 +6116,20 @@ - (void)antialiasThresholdDidChange:(NSNotification *)notification
- (void) terminate: (id)sender
{
struct input_event ie;
struct frame *f;
NSTRACE ("[EmacsApp terminate:]");
struct frame *emacsframe = SELECTED_FRAME ();
f = SELECTED_FRAME ();
EVENT_INIT (ie);
if (!emacs_event)
return;
ie.kind = NS_NONKEY_EVENT;
ie.code = KEY_NS_POWER_OFF;
ie.arg = Qt; /* mark as non-key event */
XSETFRAME (ie.frame_or_window, f);
emacs_event->kind = NS_NONKEY_EVENT;
emacs_event->code = KEY_NS_POWER_OFF;
emacs_event->arg = Qt; /* mark as non-key event */
EV_TRAILER ((id)nil);
kbd_buffer_store_event (&ie);
}
static bool
@ -8593,7 +8596,7 @@ - (void)windowDidChangeBackingProperties:(NSNotification *)notification
EmacsLayer *layer = (EmacsLayer *)[self layer];
[layer setContentsScale:[[notification object] backingScaleFactor]];
[layer setColorSpace:[[[notification object] colorSpace] CGColorSpace]];
[layer setColorSpace:[(id) [[notification object] colorSpace] CGColorSpace]];
ns_clear_frame (emacsframe);
expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));