diff options
| author | Daniel MartÃn | 2023-08-18 15:03:21 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-08-26 11:03:59 +0300 |
| commit | 5427ef23b8b3ef52faf4ab1e8401303220c2d1d1 (patch) | |
| tree | f82011d31bd04eb662ded1809f2d9aa0b5b493bd /src | |
| parent | 67ef2c14b0fd18841d5eaac8957155434a7e53da (diff) | |
| download | emacs-5427ef23b8b3ef52faf4ab1e8401303220c2d1d1.tar.gz emacs-5427ef23b8b3ef52faf4ab1e8401303220c2d1d1.zip | |
Do not raise a different frame when closing a frame
* src/frame.h: Declare an NS-only function to make a frame the
key window.
* src/nsfns.m (ns_make_frame_key_window): Implement it.
* src/frame.c (delete_frame): Call ns_make_frame_key_window
instead of Fraise_frame. (Bug#61525)
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 15 | ||||
| -rw-r--r-- | src/frame.h | 4 | ||||
| -rw-r--r-- | src/nsfns.m | 6 |
3 files changed, 19 insertions, 6 deletions
diff --git a/src/frame.c b/src/frame.c index 4be9f06bd3c..38ac316ce87 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -2212,12 +2212,15 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 2212 | } | 2212 | } |
| 2213 | #ifdef NS_IMPL_COCOA | 2213 | #ifdef NS_IMPL_COCOA |
| 2214 | else | 2214 | else |
| 2215 | /* Under NS, there is no system mechanism for choosing a new | 2215 | { |
| 2216 | window to get focus -- it is left to application code. | 2216 | /* Under NS, there is no system mechanism for choosing a new |
| 2217 | So the portion of THIS application interfacing with NS | 2217 | window to get focus -- it is left to application code. |
| 2218 | needs to know about it. We call Fraise_frame, but the | 2218 | So the portion of THIS application interfacing with NS |
| 2219 | purpose is really to transfer focus. */ | 2219 | needs to make the frame we switch to the key window. */ |
| 2220 | Fraise_frame (frame1); | 2220 | struct frame *f1 = XFRAME (frame1); |
| 2221 | if (FRAME_NS_P (f1)) | ||
| 2222 | ns_make_frame_key_window (f1); | ||
| 2223 | } | ||
| 2221 | #endif | 2224 | #endif |
| 2222 | 2225 | ||
| 2223 | do_switch_frame (frame1, 0, 1, Qnil); | 2226 | do_switch_frame (frame1, 0, 1, Qnil); |
diff --git a/src/frame.h b/src/frame.h index c85df378da6..f4726f1c0e5 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -1521,6 +1521,10 @@ extern Lisp_Object mouse_position (bool); | |||
| 1521 | extern void frame_size_history_plain (struct frame *, Lisp_Object); | 1521 | extern void frame_size_history_plain (struct frame *, Lisp_Object); |
| 1522 | extern void frame_size_history_extra (struct frame *, Lisp_Object, | 1522 | extern void frame_size_history_extra (struct frame *, Lisp_Object, |
| 1523 | int, int, int, int, int, int); | 1523 | int, int, int, int, int, int); |
| 1524 | #ifdef NS_IMPL_COCOA | ||
| 1525 | /* Implemented in nsfns.m. */ | ||
| 1526 | extern void ns_make_frame_key_window (struct frame *); | ||
| 1527 | #endif | ||
| 1524 | extern Lisp_Object Vframe_list; | 1528 | extern Lisp_Object Vframe_list; |
| 1525 | 1529 | ||
| 1526 | /* Value is a pointer to the selected frame. If the selected frame | 1530 | /* Value is a pointer to the selected frame. If the selected frame |
diff --git a/src/nsfns.m b/src/nsfns.m index b846b490ff7..a79892f73b6 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -685,6 +685,12 @@ ns_change_tab_bar_height (struct frame *f, int height) | |||
| 685 | SET_FRAME_GARBAGED (f); | 685 | SET_FRAME_GARBAGED (f); |
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | void | ||
| 689 | ns_make_frame_key_window (struct frame *f) | ||
| 690 | { | ||
| 691 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; | ||
| 692 | } | ||
| 693 | |||
| 688 | /* tabbar support */ | 694 | /* tabbar support */ |
| 689 | static void | 695 | static void |
| 690 | ns_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | 696 | ns_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) |