summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-12-28 15:10:39 +0200
committerEli Zaretskii <eliz@gnu.org>2022-12-28 15:10:39 +0200
commitb464e6c490be72e29619c5e101902ab3c3a2e474 (patch)
treed9388cf6f77a38dc71ffffbcbd2992144cb2cec2 /src/w32term.c
parenteedc9d79aed0c795b6f0687bc49993cb626c4039 (diff)
downloademacs-b464e6c490be72e29619c5e101902ab3c3a2e474.tar.gz
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/w32term.c')
-rw-r--r--src/w32term.c11
1 files changed, 9 insertions, 2 deletions
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
w32_initialize (void)
{
HANDLE shell;
+ BOOL caret;
HRESULT (WINAPI * set_user_model) (const wchar_t * id);
baud_rate = 19200;
@@ -7732,8 +7733,9 @@ w32_initialize (void)
/* Initialize w32_use_visible_system_caret based on whether a screen
reader is in use. */
- if (!SystemParametersInfo (SPI_GETSCREENREADER, 0,
- &w32_use_visible_system_caret, 0))
+ if (SystemParametersInfo (SPI_GETSCREENREADER, 0, &caret, 0))
+ w32_use_visible_system_caret = caret == TRUE;
+ else
w32_use_visible_system_caret = 0;
any_help_event_p = 0;
@@ -7923,6 +7925,11 @@ unconditionally set to nil on older systems. */);
w32_use_native_image_api = 0;
#endif
+ DEFVAR_BOOL ("w32-yes-no-dialog-show-cancel",
+ w32_yes_no_dialog_show_cancel,
+ doc: /* If non-nil, show Cancel button in MS-Windows GUI Yes/No dialogs. */);
+ w32_yes_no_dialog_show_cancel = 1;
+
/* FIXME: The following variable will be (hopefully) removed
before Emacs 25.1 gets released. */