diff --git a/etc/NEWS b/etc/NEWS index 67f9ed84bdf..39c62756085 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -29,6 +29,19 @@ applies, and please also update docstrings as needed. The traditional unexec dumper, deprecated since Emacs 27, has been removed. + +* MacOS/NS Changes in Emacs 31.1 + +--- +** New user option 'ns-click-through' controls whether activation clicks +are passed through to Emacs commands. +When nil, clicking on an inactive Emacs frame will only activate it. +When t (the default), the click will both activate the frame and be interpreted +as a command. + ++++ +** On Cocoa builds, stipples now render with color. (Bug#73384) + ** Changed GCC default options on 32-bit x86 systems. When using GCC 4 or later to build Emacs on 32-bit x86 systems, 'configure' now defaults to using the GCC options '-mfpmath=sse' (if the diff --git a/lisp/cus-start.el b/lisp/cus-start.el index c6e4da6790e..c6cdd5cc2e7 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -582,6 +582,12 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (ns-use-fullscreen-animation ns boolean "25.1") (ns-use-srgb-colorspace ns boolean "24.4") (ns-scroll-event-delta-factor ns float "29.1") + + (ns-click-through + ns (choice (const :tag "Never (nil)" :value nil) + (const :tag "Always (t)" :value t)) + "31.1") + ;; process.c (delete-exited-processes processes-basics boolean) (process-error-pause-time processes-basics integer "29.1") diff --git a/src/nsterm.m b/src/nsterm.m index e7108c817c8..fcd9377646f 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6891,7 +6891,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { NSTRACE_MSG ("First mouse event: type=%ld, clickCount=%ld", [theEvent type], [theEvent clickCount]); - return YES; + return ns_click_through; } - (void)resetCursorRects { @@ -11300,6 +11300,21 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with doc: /* SKIP: real doc in xterm.c. */); x_underline_at_descent_line = 0; + // TODO: add an "auto" mode that passes clicks through to "utility" UI + // elements, selectis windows, and so on, but doesn't pass them + // through for commands in general --- consistent with + // other applications. + + DEFVAR_BOOL ("ns-click-through", + ns_click_through, + doc: /* Whether to pass activation clicks through to Emacs. +When nil, if Emacs is not focused, the click that focuses Emacs will not +be interpreted as a common. If t, it will be. For example, when nil, +if Emacs is inactive, two clicks are needed to move point: the first to +activate Emacs and the second to activate the mouse-1 binding. When t, +only a single click is needed. */); + ns_click_through = YES; + DEFSYM (Qx_underline_at_descent_line, "x-underline-at-descent-line"); DEFVAR_LISP ("ns-scroll-event-delta-factor", Vns_scroll_event_delta_factor,