* src/nsterm.m ([EmacsView windowDidBecomeKey]): Work around
emacs_event being NULL by storing focus in events directly
into the keyboard buffer. (bug#52376)
{
struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (emacsframe);
struct frame *old_focus = dpyinfo->ns_focus_frame;
+ struct input_event event;
+
+ EVENT_INIT (event);
NSTRACE ("[EmacsView windowDidBecomeKey]");
ns_frame_rehighlight (emacsframe);
- if (emacs_event)
- {
- emacs_event->kind = FOCUS_IN_EVENT;
- EV_TRAILER ((id)nil);
- }
+ event.kind = FOCUS_IN_EVENT;
+ XSETFRAME (event.frame_or_window, emacsframe);
+ kbd_buffer_store_event (&event);
}