From: Po Lu Date: Thu, 6 Jan 2022 11:35:18 +0000 (+0800) Subject: Generate TOUCH_END_EVENTs on NS when mwheel momentum is disabled X-Git-Tag: emacs-29.0.90~3232 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b3ceeb3f2a4240736840422c272204030d113083;p=emacs.git 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. --- 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