Skip to content

Commit edbf435

Browse files
author
Eric Amodio
committed
Fixes microsoft#104508 - adds 2px for window border
1 parent b96ce60 commit edbf435

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/vs/workbench/services/hover/browser/hoverWidget.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { HoverWidget as BaseHoverWidget, renderHoverAction } from 'vs/base/brows
1616
import { Widget } from 'vs/base/browser/ui/widget';
1717
import { AnchorPosition } from 'vs/base/browser/ui/contextview/contextview';
1818
import { IOpenerService } from 'vs/platform/opener/common/opener';
19+
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
1920

2021
const $ = dom.$;
2122

@@ -48,7 +49,8 @@ export class HoverWidget extends Widget {
4849
options: IHoverOptions,
4950
@IKeybindingService private readonly _keybindingService: IKeybindingService,
5051
@IConfigurationService private readonly _configurationService: IConfigurationService,
51-
@IOpenerService private readonly _openerService: IOpenerService
52+
@IOpenerService private readonly _openerService: IOpenerService,
53+
@IWorkbenchLayoutService private readonly _workbenchLayoutService: IWorkbenchLayoutService,
5254
) {
5355
super();
5456

@@ -141,7 +143,7 @@ export class HoverWidget extends Widget {
141143
// Get horizontal alignment and position
142144
let targetLeft = this._target.x !== undefined ? this._target.x : Math.min(...targetBounds.map(e => e.left));
143145
if (targetLeft + this._hover.containerDomNode.clientWidth >= document.documentElement.clientWidth) {
144-
this._x = document.documentElement.clientWidth - 1;
146+
this._x = document.documentElement.clientWidth - (this._workbenchLayoutService.hasWindowBorder() ? 3 : 1);
145147
this._hover.containerDomNode.classList.add('right-aligned');
146148
} else {
147149
this._x = targetLeft;

0 commit comments

Comments
 (0)