]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid FOCUS_IN_EVENTS not being sent on NS
authorPo Lu <luangruo@yahoo.com>
Sat, 15 Jan 2022 13:11:57 +0000 (21:11 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 21 Jan 2022 01:00:59 +0000 (09:00 +0800)
* src/nsterm.m ([EmacsView windowDidBecomeKey]): Work around
emacs_event being NULL by storing focus in events directly
into the keyboard buffer.  (bug#52376)

src/nsterm.m

index 4f60cc737da9ccc618ea64e2f24ce2073dade4d8..a3c7b55218c452e2b8084716fb5f31e64dc22130 100644 (file)
@@ -7071,6 +7071,9 @@ not_in_argv (NSString *arg)
 {
   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]");
 
@@ -7079,11 +7082,9 @@ not_in_argv (NSString *arg)
 
   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);
 }