aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2022-12-28 15:10:39 +0200
committerEli Zaretskii2022-12-28 15:10:39 +0200
commitb464e6c490be72e29619c5e101902ab3c3a2e474 (patch)
treed9388cf6f77a38dc71ffffbcbd2992144cb2cec2 /src
parenteedc9d79aed0c795b6f0687bc49993cb626c4039 (diff)
downloademacs-b464e6c490be72e29619c5e101902ab3c3a2e474.tar.gz
emacs-b464e6c490be72e29619c5e101902ab3c3a2e474.zip
Make last change of w32 GUI dialogs conditional and reversible
* src/w32term.c (syms_of_w32term) <w32-yes-no-dialog-show-cancel>: New boolean variable. (w32_initialize): Fix query for visible system caret: 'bool' is a single-byte data type, whereas SystemParametersInfo wants a BOOL, which is a 32-bit int. * src/w32menu.c (simple_dialog_show): Show "Cancel" button only if 'w32-yes-no-dialog-show-cancel' is non-nil. * etc/NEWS: Announce the change.
Diffstat (limited to 'src')
-rw-r--r--src/w32menu.c5
-rw-r--r--src/w32term.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/src/w32menu.c b/src/w32menu.c
index c6d1efaf25b..5f06f4c4170 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1091,7 +1091,10 @@ simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header)
1091 /* We use MB_YESNOCANCEL to allow the user the equivalent of C-g 1091 /* We use MB_YESNOCANCEL to allow the user the equivalent of C-g
1092 when the Yes/No question is asked vya y-or-n-p or 1092 when the Yes/No question is asked vya y-or-n-p or
1093 yes-or-no-p. */ 1093 yes-or-no-p. */
1094 type = MB_YESNOCANCEL; 1094 if (w32_yes_no_dialog_show_cancel)
1095 type = MB_YESNOCANCEL;
1096 else
1097 type = MB_YESNO;
1095 1098
1096 /* Since we only handle Yes/No dialogs, and we already checked 1099 /* Since we only handle Yes/No dialogs, and we already checked
1097 is_simple_dialog, we don't need to worry about checking contents 1100 is_simple_dialog, we don't need to worry about checking contents
diff --git a/src/w32term.c b/src/w32term.c
index dff21489e5b..e40e4588fde 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -7696,6 +7696,7 @@ static void
7696w32_initialize (void) 7696w32_initialize (void)
7697{ 7697{
7698 HANDLE shell; 7698 HANDLE shell;
7699 BOOL caret;
7699 HRESULT (WINAPI * set_user_model) (const wchar_t * id); 7700 HRESULT (WINAPI * set_user_model) (const wchar_t * id);
7700 7701
7701 baud_rate = 19200; 7702 baud_rate = 19200;
@@ -7732,8 +7733,9 @@ w32_initialize (void)
7732 7733
7733 /* Initialize w32_use_visible_system_caret based on whether a screen 7734 /* Initialize w32_use_visible_system_caret based on whether a screen
7734 reader is in use. */ 7735 reader is in use. */
7735 if (!SystemParametersInfo (SPI_GETSCREENREADER, 0, 7736 if (SystemParametersInfo (SPI_GETSCREENREADER, 0, &caret, 0))
7736 &w32_use_visible_system_caret, 0)) 7737 w32_use_visible_system_caret = caret == TRUE;
7738 else
7737 w32_use_visible_system_caret = 0; 7739 w32_use_visible_system_caret = 0;
7738 7740
7739 any_help_event_p = 0; 7741 any_help_event_p = 0;
@@ -7923,6 +7925,11 @@ unconditionally set to nil on older systems. */);
7923 w32_use_native_image_api = 0; 7925 w32_use_native_image_api = 0;
7924#endif 7926#endif
7925 7927
7928 DEFVAR_BOOL ("w32-yes-no-dialog-show-cancel",
7929 w32_yes_no_dialog_show_cancel,
7930 doc: /* If non-nil, show Cancel button in MS-Windows GUI Yes/No dialogs. */);
7931 w32_yes_no_dialog_show_cancel = 1;
7932
7926 /* FIXME: The following variable will be (hopefully) removed 7933 /* FIXME: The following variable will be (hopefully) removed
7927 before Emacs 25.1 gets released. */ 7934 before Emacs 25.1 gets released. */
7928 7935