diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-06-04 18:59:09 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-06-04 18:59:09 +0400 |
commit | 680a6ad9327fc056854cac0a3e7679a32cb63a93 (patch) | |
tree | e0bf50ef593d2b32ff034b0eb700f7a664f8d4ee /src/nsmenu.m | |
parent | 350aea695f9ad367e066bf073da2a0bb1d9a56bd (diff) | |
download | emacs-680a6ad9327fc056854cac0a3e7679a32cb63a93.tar.gz |
Use terminal-specific hooks to display popup dialogs.
* termhooks.h (struct terminal): New field popup_dialog_hook.
* menu.c (emulate_dialog_with_menu): New function, refactored from ...
(Fx_popup_dialog): ... adjusted user. Also remove old #if 0
code and use popup_dialog_hook.
* nsmenu.m (ns_popup_dialog): Make hook-compatible.
* nsterm.h (ns_popup_dialog): Adjust prototype.
* nsterm.m (ns_create_terminal):
* w32term.c (w32_create_terminal):
* xterm.c (x_create_terminal) [USE_X_TOOLKIT || USE_GTK]: Setup
popup_dialog_hook.
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r-- | src/nsmenu.m | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index 65494cb2582..24c1189584b 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1428,11 +1428,10 @@ pop_down_menu (void *arg) Lisp_Object -ns_popup_dialog (Lisp_Object position, Lisp_Object header, Lisp_Object contents) +ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) { id dialog; Lisp_Object window, tem, title; - struct frame *f; NSPoint p; BOOL isQ; NSAutoreleasePool *pool; @@ -1441,41 +1440,6 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object header, Lisp_Object contents) isQ = NILP (header); - if (EQ (position, Qt) - || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar) - || EQ (XCAR (position), Qtool_bar)))) - { - window = selected_window; - } - else if (CONSP (position)) - { - Lisp_Object tem; - tem = Fcar (position); - if (XTYPE (tem) == Lisp_Cons) - window = Fcar (Fcdr (position)); - else - { - tem = Fcar (Fcdr (position)); /* EVENT_START (position) */ - window = Fcar (tem); /* POSN_WINDOW (tem) */ - } - } - else if (WINDOWP (position) || FRAMEP (position)) - { - window = position; - } - else - window = Qnil; - - if (FRAMEP (window)) - f = XFRAME (window); - else if (WINDOWP (window)) - { - CHECK_LIVE_WINDOW (window); - f = XFRAME (WINDOW_FRAME (XWINDOW (window))); - } - else - CHECK_WINDOW (window); - check_window_system (f); p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; |