summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-06 19:35:18 +0800
committerPo Lu <luangruo@yahoo.com>2022-01-06 19:35:18 +0800
commitb3ceeb3f2a4240736840422c272204030d113083 (patch)
treef969be4ca8d0460a55e217c758e7e4faa76afd40
parent9fc20ad35c8dd1814ba097a0ec20c0230c467729 (diff)
downloademacs-b3ceeb3f2a4240736840422c272204030d113083.tar.gz
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)
int x = 0, y = 0;
int scrollUp = NO;
+ static bool end_flag = false;
+
+ if (!ns_use_mwheel_momentum && !end_flag
+ && [theEvent momentumPhase] != NSEventPhaseNone)
+ {
+ emacs_event->kind = TOUCH_END_EVENT;
+ emacs_event->arg = Qnil;
+ end_flag = [theEvent momentumPhase] != NSEventPhaseNone;
+ XSETINT (emacs_event->x, lrint (p.x));
+ XSETINT (emacs_event->y, lrint (p.y));
+ EV_TRAILER (theEvent);
+ return;
+ }
+
+ end_flag = [theEvent momentumPhase] != NSEventPhaseNone;
+
/* FIXME: At the top or bottom of the buffer we should
* ignore momentum-phase events. */
if (! ns_use_mwheel_momentum