]> git.eshelyaron.com Git - emacs.git/commitdiff
Reenable reporting of frame movement on NS
authorPo Lu <luangruo@yahoo.com>
Wed, 7 Sep 2022 01:07:59 +0000 (09:07 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 7 Sep 2022 01:52:35 +0000 (09:52 +0800)
* src/nsterm.m ([EmacsView windowDidMove:]): Restore code to
generate MOVE_FRAME_EVENTS, and use kbd_buffer_store_event
instead.

src/nsterm.m

index 6c6151701b843335ab06ddf881f9638bfb89b811..d6290449b4329d14d2210876774da154eee913cf 100644 (file)
@@ -7912,22 +7912,28 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action)
   NSRect r = [win frame];
   NSArray *screens = [NSScreen screens];
   NSScreen *screen = [screens objectAtIndex: 0];
+  struct input_event ie;
 
   NSTRACE ("[EmacsView windowDidMove:]");
 
   if (!emacsframe->output_data.ns)
     return;
+
   if (screen != nil)
     {
-      emacsframe->left_pos = NSMinX (r) - NS_PARENT_WINDOW_LEFT_POS (emacsframe);
-      emacsframe->top_pos = NS_PARENT_WINDOW_TOP_POS (emacsframe) - NSMaxY (r);
+      emacsframe->left_pos = (NSMinX (r)
+                             - NS_PARENT_WINDOW_LEFT_POS (emacsframe));
+      emacsframe->top_pos = (NS_PARENT_WINDOW_TOP_POS (emacsframe)
+                            - NSMaxY (r));
 
-      // FIXME: after event part below didExitFullScreen is not received
-      // if (emacs_event)
-      //   {
-      //     emacs_event->kind = MOVE_FRAME_EVENT;
-      //     EV_TRAILER ((id)nil);
-      //   }
+      if (emacs_event)
+       {
+         ie.kind = MOVE_FRAME_EVENT;
+         XSETFRAME (ie.frame_or_window, emacsframe);
+         XSETINT (ie.x, emacsframe->left_pos);
+         XSETINT (ie.y, emacsframe->top_pos);
+         kbd_buffer_store_event (&ie);
+       }
     }
 }