diff options
author | Po Lu <luangruo@yahoo.com> | 2022-05-14 21:35:05 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-05-14 21:35:05 +0800 |
commit | 2c4e9985922b106389abf659d63d8dd721f2a9bc (patch) | |
tree | 4ae0d278df01bfc0e53a0f635f0d436c8988e52d /src/nsmenu.m | |
parent | 5aef501d9c3394599dd2e48ff7ba7bb5f13cd19a (diff) | |
download | emacs-2c4e9985922b106389abf659d63d8dd721f2a9bc.tar.gz |
Minor fixes for popup dialogs on macOS
* nsmenu.m (pop_down_menu): Restore old hack for macOS.
([EmacsDialogPanel initWithTitle:isQuestion:]): Set command
title correctly.
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r-- | src/nsmenu.m | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index 1ebaca4e872..2219d6cf998 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1540,6 +1540,12 @@ pop_down_menu (void *arg) { popup_activated_flag = 0; [panel close]; + /* For some reason this is required on macOS, or the selected + frame gets the keyboard focus but doesn't become + highlighted. */ +#ifdef NS_IMPL_COCOA + [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; +#endif discard_menu_items (); } } @@ -1847,10 +1853,11 @@ ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) if (title_string) [title setStringValue: [NSString stringWithUTF8String: title_string]]; - else if (is_question) - [title setStringValue: @"Question"]; + + if (is_question) + [command setStringValue: @"Question"]; else - [title setStringValue: @"Information"]; + [command setStringValue: @"Information"]; return self; } |