From 680a6ad9327fc056854cac0a3e7679a32cb63a93 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 4 Jun 2014 18:59:09 +0400 Subject: 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. --- src/nsmenu.m | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'src/nsmenu.m') 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; -- cgit v1.2.1