+2014-02-04 Eli Zaretskii <eliz@gnu.org>
+
+ * w32menu.c (w32_popup_dialog): Don't condition the whole function
+ on HAVE_DIALOGS. If the dialog is "simple", pop up a message box
+ to show it; otherwise return 'unsupported--w32-dialog' to signal
+ to the caller that emulation with menus is necessary. This
+ resurrects code inadvertently deleted by the 2013-10-08 commit.
+ (Bug#16636)
+ (syms_of_w32menu): DEFSYM Qunsupported__w32_dialog.
+
+ * w32term.h (w32_popup_dialog): Prototype is no longer conditioned
+ by HAVE_DIALOGS.
+
+ * menu.c (Fx_popup_dialog): Don't condition the call to
+ w32_popup_dialog on HAVE_DIALOGS. If w32_popup_dialog returns a
+ special symbol 'unsupported--w32-dialog', emulate the dialog with
+ a menu by calling x-popup-menu.
+
+ * menu.h (Qunsupported__w32_dialog): New extern variable.
+
2014-02-04 Michael Albinus <michael.albinus@gmx.de>
* keyboard.c (kbd_buffer_get_event): Read file notification events
return xw_popup_dialog (f, header, contents);
else
#endif
-#if defined (HAVE_NTGUI) && defined (HAVE_DIALOGS)
+#if defined (HAVE_NTGUI)
if (FRAME_W32_P (f))
- return w32_popup_dialog (f, header, contents);
+ {
+ Lisp_Object selection = w32_popup_dialog (f, header, contents);
+
+ if (!EQ (selection, Qunsupported__w32_dialog))
+ return selection;
+ goto dialog_via_menu;
+ }
else
#endif
#ifdef HAVE_NS
Lisp_Object x, y, frame, newpos, prompt;
int x_coord, y_coord;
+ dialog_via_menu:
+
prompt = Fcar (contents);
if (FRAME_WINDOW_P (f))
{
MessageBoxW_Proc unicode_message_box = NULL;
#endif /* NTGUI_UNICODE */
-Lisp_Object Qdebug_on_next_call;
+Lisp_Object Qdebug_on_next_call, Qunsupported__w32_dialog;
void set_frame_menubar (struct frame *, bool, bool);
void w32_free_menu_strings (HWND);
-#ifdef HAVE_DIALOGS
Lisp_Object
w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
{
- Lisp_Object title;
- char *error_name;
- Lisp_Object selection;
check_window_system (f);
- /* Decode the dialog items from what was specified. */
- title = Fcar (contents);
- CHECK_STRING (title);
+#ifndef HAVE_DIALOGS
- list_of_panes (Fcons (contents, Qnil));
+ /* Handle simple Yes/No choices as MessageBox popups. */
+ if (is_simple_dialog (contents))
+ return simple_dialog_show (f, contents, header);
+ else
+ return Qunsupported__w32_dialog;
+#else /* HAVE_DIALOGS */
+ {
+ Lisp_Object title;
+ char *error_name;
+ Lisp_Object selection;
- /* Display them in a dialog box. */
- block_input ();
- selection = w32_dialog_show (f, 0, title, header, &error_name);
- unblock_input ();
+ /* Decode the dialog items from what was specified. */
+ title = Fcar (contents);
+ CHECK_STRING (title);
- discard_menu_items ();
- FRAME_DISPLAY_INFO (f)->grabbed = 0;
+ list_of_panes (Fcons (contents, Qnil));
- if (error_name) error (error_name);
- return selection;
-}
+ /* Display them in a dialog box. */
+ block_input ();
+ selection = w32_dialog_show (f, 0, title, header, &error_name);
+ unblock_input ();
+
+ discard_menu_items ();
+ FRAME_DISPLAY_INFO (f)->grabbed = 0;
+
+ if (error_name) error (error_name);
+ return selection;
+ }
#endif /* HAVE_DIALOGS */
+}
/* Activate the menu bar of frame F.
This is called from keyboard.c when it gets the
current_popup_menu = NULL;
DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
+ DEFSYM (Qunsupported__w32_dialog, "unsupported--w32-dialog");
defsubr (&Smenu_or_popup_active_p);
}