From: Po Lu Date: Sat, 14 May 2022 13:35:05 +0000 (+0800) Subject: Minor fixes for popup dialogs on macOS X-Git-Tag: emacs-29.0.90~1910^2~696 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2c4e9985922b106389abf659d63d8dd721f2a9bc;p=emacs.git Minor fixes for popup dialogs on macOS * nsmenu.m (pop_down_menu): Restore old hack for macOS. ([EmacsDialogPanel initWithTitle:isQuestion:]): Set command title correctly. --- 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; }