Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.63.0 OS Version: Windows 11 Steps to Reproduce: a file where breakpoints can be set around the edge of the editor, in and out of the margin until the breakpoint stays even though the mouse is outside of the editor (see GIF below). ! This is important to me because I am using margin decorations in Monaco and running into the same issue there. Internally the event isn't triggered, so the decorations aren't removed. It seems to be specific to decorations in the glyph margin, as without these (e.g. line decorations) it doesn't seem to reproduce.
I can reproduce when moving the mouse quickly. I find it interesting that also the scrollbars suffer form the same problem (the scrollbars listen independently to ). I've also tried locally to replace with the somewhat more modern and I could still reproduce. Basically the browser simply forgets soemtiems to send us a or a event: <img width="538" alt="image" src="https://user-"

Discussion:
import * as dom from 'vs/base/browser/dom'; import { StandardWheelEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; import { TimeoutTimer } from 'vs/base/common/async'; <del> import { Disposable } from 'vs/base/common/lifecycle'; </del> <ins> import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; </ins> import * as platform from 'vs/base/common/platform'; import { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from 'vs/editor/browser/controller/mouseTarget'; import { IMouseTarget, IMouseTargetViewZoneData, MouseTargetType } from 'vs/editor/browser/editorBrowser';

protected readonly _mouseDownOperation: MouseDownOperation; private lastMouseLeaveTime: number; private _height: number; <ins> private _mouseLeaveMonitor: IDisposable | null = null; </ins> constructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) { super();

this._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true))); <del> this._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e))); </del> <ins> this._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => { this._onMouseMove(e); // See https://github.com/microsoft/vscode/issues/138789 // When moving the mouse really quickly, the browser sometimes forgets to // send us a `mouseleave` or `mouseout` event. We therefore install here // a global `mousemove` listener to manually recover if the mouse goes outside // the editor. As soon as the mouse leaves outside of the editor, we // remove this listener if (!this._mouseLeaveMonitor) { this._mouseLeaveMonitor = dom.addDisposableListener(document, 'mousemove', (e) => { if (!this.viewHelper.viewDomNode.contains(e.target as Node | null)) { // went outside the editor! this._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode)); } }); } })); </ins> this._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));

public override dispose(): void { this._context.removeEventHandler(this); <ins> if (this._mouseLeaveMonitor) { this._mouseLeaveMonitor.dispose(); this._mouseLeaveMonitor = null; } </ins> super.dispose(); }

} public _onMouseLeave(e: EditorMouseEvent): void { <ins> if (this._mouseLeaveMonitor) { this._mouseLeaveMonitor.dispose(); this._mouseLeaveMonitor = null; } </ins> this.lastMouseLeaveTime = (new Date()).getTime(); this.viewController.emitMouseLeave({ event: e,