diff options
author | Adrian Robert <Adrian.B.Robert@gmail.com> | 2009-01-25 19:43:31 +0000 |
---|---|---|
committer | Adrian Robert <Adrian.B.Robert@gmail.com> | 2009-01-25 19:43:31 +0000 |
commit | 8612b71a44b34519fe1b047a9f1d6f6b1431d411 (patch) | |
tree | cc7567046437fef05a5f60a93518c8c8a2b49bcc /src/nsmenu.m | |
parent | 0cb6149297b30250a6dc460ecb700a96bf576ea9 (diff) | |
download | emacs-8612b71a44b34519fe1b047a9f1d6f6b1431d411.tar.gz |
Changes to remove Feval calls from GUI under NS.
* nsterm.h: Move KEY_NS_... definitions here from nsterm.m. Add
NS_TOGGLE_TOOLBAR, NS_PUT_WORKING_TEXT, NS_UNPUT_WORKING_TEXT.
Remove NS_INSERT_WORKING_TEXT, NS_DELETE_WORKING_TEXT.
* nsterm.m: Move KEY_NS_... definitions to nsterm.h.
(EmacsView-toggleToolbar:): Use KEY_NS_TOGGLE_TOOLBAR.
(EmacsView-setMarkedText:,-deleteWorkingText:): Use NS_TEXT_EVENT
instead of NON_ASCII_KEYSTROKE_EVENT.
(EmacsApp-terminate:): Use KEY_NS_POWER_OFF instead of Feval.
(EmacsApp-applicationShouldTerminate:): Query user.
(EmacsPreferencesController-runHelp:): Use KEY_NS_INFO_PREFS
instead of Feval.
* termhooks.h (NS_TEXT_EVENT): New event type under HAVE_NS.
* keyboard.c (kbd_buffer_get_event): Check for it.
(keys_of_keyboard): Define lispy keys for
ns-put/unput-working-text.
* nsmenu.m (ns_popup_dialog): Resync window setting with X and W32
versions.
(EmacsDialog-runDialogAt:): Use NSModalPanelRunLoopMode.
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r-- | src/nsmenu.m | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index 94e8cb73fa8..b3c56809733 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1500,7 +1500,9 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) isQ = NILP (header); - if (EQ (position, Qt)) + if (EQ (position, Qt) + || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar) + || EQ (XCAR (position), Qtool_bar)))) { window = selected_window; } @@ -1516,23 +1518,23 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) window = Fcar (tem); /* POSN_WINDOW (tem) */ } } - else if (FRAMEP (position)) + else if (WINDOWP (position) || FRAMEP (position)) { window = position; } else - { - CHECK_LIVE_WINDOW (position); - window = position; - } - + window = Qnil; + if (FRAMEP (window)) f = XFRAME (window); - else + else if (WINDOWP (window)) { CHECK_LIVE_WINDOW (window); f = XFRAME (WINDOW_FRAME (XWINDOW (window))); } + else + CHECK_WINDOW (window); + p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; p.y = (int)f->top_pos + (FRAME_LINE_HEIGHT (f) * f->text_lines)/2; dialog = [[EmacsDialogPanel alloc] initFromContents: contents @@ -1860,9 +1862,9 @@ void process_dialog (id window, Lisp_Object list) { (e = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: [NSDate distantFuture] - inMode: NSEventTrackingRunLoopMode + inMode: NSModalPanelRunLoopMode dequeue: NO]); -/*fprintf (stderr, "ret = %d\te = %p\n", ret, e); */ +/*fprintf (stderr, "ret = %d\te = %p\n", ret, e);*/ } [NSApp endModalSession: session]; |