Change:
a breakpoint or log here or copy a file into a new floating window between them a few times. The event fires a couple times but then stops firing
does it reproduce without having devtools opened in any of the windows?
this one takes me by surprise: in the main process I keep track of auxiliary windows and so far I have been using as identifier, assuming it would always match . But as it turns out, that is actually not always the case: if I open devtools and restart or reload, I see how suddenly of does not match the of anymore. In other words, I see an id of for example for the of the floating window, while its has an of . So I do think that I am doing something wrong and I need a different way how to figure out the window ID of a floating window... I track the creation of floating windows here from the :
Ah, that's the repro. Yes, you must have devtools open when you open the aux window. Opening them after the aux window is already open doesn't cause an issue, but once you do open them then the event won't fire properly until vs code is restarted
That is not the intended contract in the runtime, a BrowserWindow can have multiple WebContents at any point and their ids are independent. WebContent ids are incremental within the same process, so it purely depends on the creation order. You can use to get the owner window and that should give you the right id.
I tried that, but at the time fires, returns . In other words, the web content is being created before the window is there... So essentially, I have no way to find the window for the web contents so early.
I think maintaining a would suit this scenario, you can access the webContents a BrowserWindow owns via and this will be valid even at . Should be reliable than id.
Yeah, an alternative would be to pro-long aux-window handshake between main and renderer until the is there but I think thats overkill. I will see to keep aux windows identified by . Its a bit inconsistent because both aux and main window share the same base class and the one will use and the other ...
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!

Discussion:
private activeActions: IAction[]; private updateScheduler: RunOnceScheduler; private debugToolBarMenu: IMenu; <del> private yCoordinate = 0; </del> private isVisible = false; private isBuilt = false;

} if (e.affectsConfiguration(LayoutSettings.EDITOR_TABS_MODE) || e.affectsConfiguration(LayoutSettings.COMMAND_CENTER)) { this._yRange = undefined; <del> this.setYCoordinate(); </del> <ins> this.setCoordinates(); </ins> } })); this._register(this.debugToolBarMenu.onDidChange(() => this.updateScheduler.schedule()));

}); })); <del> this._register(this.layoutService.onDidChangePartVisibility(() => this.setYCoordinate())); </del> <ins> this._register(this.layoutService.onDidChangePartVisibility(() => this.setCoordinates())); </ins> const resizeListener = this._register(new MutableDisposable()); <ins> const registerResizeListener = () => { resizeListener.value = this._register(dom.addDisposableListener( dom.getWindow(this.layoutService.activeContainer), dom.EventType.RESIZE, () => this.setCoordinates()) ); }; </ins> this._register(this.layoutService.onDidChangeActiveContainer(async () => { this._yRange = undefined;

this.setCoordinates(); } <del> resizeListener.value = this._register(dom.addDisposableListener( dom.getWindow(this.layoutService.activeContainer), dom.EventType.RESIZE, () => this.setYCoordinate())); </del> <ins> registerResizeListener(); </ins> })); <ins> registerResizeListener(); </ins> } private storePosition(): void { const activeWindow = dom.getWindow(this.layoutService.activeContainer); const isMainWindow = this.layoutService.activeContainer === this.layoutService.mainContainer; <del> const left = this.$el.getBoundingClientRect().left / activeWindow.innerWidth; </del> <ins> const rect = this.$el.getBoundingClientRect(); const y = rect.top; const x = rect.left / activeWindow.innerWidth; </ins> if (isMainWindow) { <del> this.storageService.store(DEBUG_TOOLBAR_POSITION_KEY, left, StorageScope.PROFILE, StorageTarget.MACHINE); this.storageService.store(DEBUG_TOOLBAR_Y_KEY, this.yCoordinate, StorageScope.PROFILE, StorageTarget.MACHINE); </del> <ins> this.storageService.store(DEBUG_TOOLBAR_POSITION_KEY, x, StorageScope.PROFILE, StorageTarget.MACHINE); this.storageService.store(DEBUG_TOOLBAR_Y_KEY, y, StorageScope.PROFILE, StorageTarget.MACHINE); </ins> } else { <del> this.auxWindowCoordinates.set(activeWindow, { x: left, y: this.yCoordinate }); </del> <ins> this.auxWindowCoordinates.set(activeWindow, { x, y }); </ins> } }

this.setYCoordinate(y ?? this.yDefault); } <del> private setYCoordinate(y = this.yCoordinate): void { </del> <ins> private setYCoordinate(y: number): void { </ins> const [yMin, yMax] = this.yRange; y = Math.max(yMin, Math.min(y, yMax)); this.$el.style.top = `${y}px`; <del> this.yCoordinate = y; </del> } private get yDefault() {

private doShowInActiveContainer(): void { this.layoutService.activeContainer.appendChild(this.$el); <del> this.trackPixelRatioListener.value = PixelRatio.getInstance(dom.getWindow(this.$el)).onDidChange(() => this.setYCoordinate()); </del> <ins> this.trackPixelRatioListener.value = PixelRatio.getInstance(dom.getWindow(this.$el)).onDidChange( () => this.setCoordinates() ); </ins> } private hide(): void {