From: Po Lu Date: Wed, 7 Sep 2022 01:07:59 +0000 (+0800) Subject: Reenable reporting of frame movement on NS X-Git-Tag: emacs-29.0.90~1856^2~685 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=976965eb5ed00ddc8806b2adcbd5761189823f2c;p=emacs.git Reenable reporting of frame movement on NS * src/nsterm.m ([EmacsView windowDidMove:]): Restore code to generate MOVE_FRAME_EVENTS, and use kbd_buffer_store_event instead. --- diff --git a/src/nsterm.m b/src/nsterm.m index 6c6151701b8..d6290449b43 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -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); + } } }