aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2022-01-06 19:35:18 +0800
committerPo Lu2022-01-06 19:35:18 +0800
commitb3ceeb3f2a4240736840422c272204030d113083 (patch)
treef969be4ca8d0460a55e217c758e7e4faa76afd40
parent9fc20ad35c8dd1814ba097a0ec20c0230c467729 (diff)
downloademacs-b3ceeb3f2a4240736840422c272204030d113083.tar.gz
emacs-b3ceeb3f2a4240736840422c272204030d113083.zip
Generate TOUCH_END_EVENTs on NS when mwheel momentum is disabled
* src/nsterm.m ([EmacsView mouseDown:]): Generate TOUCH_END_EVENTs on the first event whose momentum phase is not NSEventPhaseNone.
-rw-r--r--src/nsterm.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 428d1a2fe22..a15dc47a226 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6519,6 +6519,22 @@ not_in_argv (NSString *arg)
6519 int x = 0, y = 0; 6519 int x = 0, y = 0;
6520 int scrollUp = NO; 6520 int scrollUp = NO;
6521 6521
6522 static bool end_flag = false;
6523
6524 if (!ns_use_mwheel_momentum && !end_flag
6525 && [theEvent momentumPhase] != NSEventPhaseNone)
6526 {
6527 emacs_event->kind = TOUCH_END_EVENT;
6528 emacs_event->arg = Qnil;
6529 end_flag = [theEvent momentumPhase] != NSEventPhaseNone;
6530 XSETINT (emacs_event->x, lrint (p.x));
6531 XSETINT (emacs_event->y, lrint (p.y));
6532 EV_TRAILER (theEvent);
6533 return;
6534 }
6535
6536 end_flag = [theEvent momentumPhase] != NSEventPhaseNone;
6537
6522 /* FIXME: At the top or bottom of the buffer we should 6538 /* FIXME: At the top or bottom of the buffer we should
6523 * ignore momentum-phase events. */ 6539 * ignore momentum-phase events. */
6524 if (! ns_use_mwheel_momentum 6540 if (! ns_use_mwheel_momentum