File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/vs/editor/browser/controller Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ export class MouseHandler extends ViewEventHandler {
115
115
mousePointerId = pointerId ;
116
116
}
117
117
} ) ) ;
118
+ // The `pointerup` listener registered by `GlobalEditorPointerMoveMonitor` does not get invoked 100% of the times.
119
+ // I speculate that this is because the `pointerup` listener is only registered during the `mousedown` event, and perhaps
120
+ // the `pointerup` event is already queued for dispatching, which makes it that the new listener doesn't get fired.
121
+ // See https://github.com/microsoft/vscode/issues/146486 for repro steps.
122
+ // To compensate for that, we simply register here a `pointerup` listener and just communicate it.
123
+ this . _register ( dom . addDisposableListener ( this . viewHelper . viewDomNode , dom . EventType . POINTER_UP , ( e : PointerEvent ) => {
124
+ this . _mouseDownOperation . onPointerUp ( ) ;
125
+ } ) ) ;
118
126
this . _register ( mouseEvents . onMouseDown ( this . viewHelper . viewDomNode , ( e ) => this . _onMouseDown ( e , mousePointerId ) ) ) ;
119
127
120
128
const onMouseWheel = ( browserEvent : IMouseWheelEvent ) => {
@@ -443,6 +451,10 @@ class MouseDownOperation extends Disposable {
443
451
this . _mouseMoveMonitor . stopMonitoring ( ) ;
444
452
}
445
453
454
+ public onPointerUp ( ) : void {
455
+ this . _mouseMoveMonitor . stopMonitoring ( ) ;
456
+ }
457
+
446
458
public onScrollChanged ( ) : void {
447
459
if ( ! this . _isActive ) {
448
460
return ;
You can’t perform that action at this time.
0 commit comments