aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Colascione2025-03-04 08:14:43 -0800
committerDaniel Colascione2025-03-04 08:14:59 -0800
commit3a8ce5ac9c4652eb87bf0bce835d82083061a28b (patch)
tree8fe76424531f11dc261ed45931e1bf8ddb25449a /src
parenta382bfdfa4b8692bcb971eec1516e37a58b3fc2f (diff)
downloademacs-3a8ce5ac9c4652eb87bf0bce835d82083061a28b.tar.gz
emacs-3a8ce5ac9c4652eb87bf0bce835d82083061a28b.zip
Add ns-click-through option to control activation click handling
* src/nsterm.m (acceptsFirstMouse): Use ns_click_through variable instead of always returning YES. (syms_of_nsterm): Define ns-click-through variable. * lisp/cus-start.el: Add customization definition for ns-click-through. * etc/NEWS: Document the new option.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m17
1 files changed, 16 insertions, 1 deletions
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 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action)
6891{ 6891{
6892 NSTRACE_MSG ("First mouse event: type=%ld, clickCount=%ld", 6892 NSTRACE_MSG ("First mouse event: type=%ld, clickCount=%ld",
6893 [theEvent type], [theEvent clickCount]); 6893 [theEvent type], [theEvent clickCount]);
6894 return YES; 6894 return ns_click_through;
6895} 6895}
6896- (void)resetCursorRects 6896- (void)resetCursorRects
6897{ 6897{
@@ -11300,6 +11300,21 @@ This variable is ignored on macOS < 10.7 and GNUstep. Default is t. */);
11300 doc: /* SKIP: real doc in xterm.c. */); 11300 doc: /* SKIP: real doc in xterm.c. */);
11301 x_underline_at_descent_line = 0; 11301 x_underline_at_descent_line = 0;
11302 11302
11303 // TODO: add an "auto" mode that passes clicks through to "utility" UI
11304 // elements, selectis windows, and so on, but doesn't pass them
11305 // through for commands in general --- consistent with
11306 // other applications.
11307
11308 DEFVAR_BOOL ("ns-click-through",
11309 ns_click_through,
11310 doc: /* Whether to pass activation clicks through to Emacs.
11311When nil, if Emacs is not focused, the click that focuses Emacs will not
11312be interpreted as a common. If t, it will be. For example, when nil,
11313if Emacs is inactive, two clicks are needed to move point: the first to
11314activate Emacs and the second to activate the mouse-1 binding. When t,
11315only a single click is needed. */);
11316 ns_click_through = YES;
11317
11303 DEFSYM (Qx_underline_at_descent_line, "x-underline-at-descent-line"); 11318 DEFSYM (Qx_underline_at_descent_line, "x-underline-at-descent-line");
11304 11319
11305 DEFVAR_LISP ("ns-scroll-event-delta-factor", Vns_scroll_event_delta_factor, 11320 DEFVAR_LISP ("ns-scroll-event-delta-factor", Vns_scroll_event_delta_factor,