Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu and hovers shifted with negative zooms #232750

Open
h-brockmann opened this issue Oct 31, 2024 · 5 comments · May be fixed by #233686
Open

Menu and hovers shifted with negative zooms #232750

h-brockmann opened this issue Oct 31, 2024 · 5 comments · May be fixed by #233686
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member important Issue identified as high-priority regression Something that used to work is now broken titlebar VS Code main title bar issues zoom VS Code window zoom issues
Milestone

Comments

@h-brockmann
Copy link

Type: Bug

Menus from the menu bar are shifted to the right. Due to smaller fontsize.
Reproducable by using [ctrl] + [-] and using the menu bar

VS Code version: Code 1.95.0 (912bb68, 2024-10-28T20:16:24.561Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 x 3302)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.69GB (3.24GB free)
Process Argv --crash-reporter-id 9e5f6a97-efb7-460d-9b3c-58da5db06fa4
Screen Reader no
VM 0%
Extensions (30)
Extension Author (truncated) Version
increment-selection alb 0.2.0
stackoverflow-search Ale 1.2.0
gitstash art 5.2.0
todo-tree Gru 0.0.226
githd hui 2.5.3
RelativePath jak 1.5.0
javadoc-tools mad 1.6.0
string-manipulation mar 0.7.25
ecdc mit 1.8.0
vscode-docker ms- 1.29.3
remote-containers ms- 0.388.0
remote-wsl ms- 0.88.5
fabric8-analytics red 0.9.5
java red 1.36.0
vscode-yaml red 1.15.0
LiveServer rit 5.7.9
copy-relative-path-posix rss 0.0.4
dot Ste 0.0.1
code-spell-checker str 3.0.1
code-spell-checker-german str 2.3.2
graphviz-interactive-preview tin 0.3.5
intellicode-api-usage-examples Vis 0.2.9
vscodeintellicode Vis 1.3.2
vscode-gradle vsc 3.16.4
vscode-java-debug vsc 0.58.1
vscode-java-dependency vsc 0.24.0
vscode-java-pack vsc 0.29.0
vscode-java-test vsc 0.42.0
vscode-maven vsc 0.44.0
open-in-external-app YuT 0.10.0
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
jg8ic977:31013176
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013

@h-brockmann
Copy link
Author

Image

@sbatten
Copy link
Member

sbatten commented Oct 31, 2024

@bpasero @deepak1556 @benibenj I have not touched this and its a recent regression. I used vscode-bisect to narrow to this range which includes esbuild stuff and electron updates c33745f...af6645a

@sbatten sbatten assigned benibenj and unassigned sbatten Oct 31, 2024
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug zoom VS Code window zoom issues titlebar VS Code main title bar issues confirmed Issue has been confirmed by VS Code Team member labels Nov 1, 2024
@bpasero bpasero changed the title Menu shifted due to changed fontsize Menu and hovers shifted with negative zooms Nov 1, 2024
@bpasero
Copy link
Member

bpasero commented Nov 1, 2024

Yes, I can reproduce. I would think its the Electron 32 update, as the ESM changes from Jo were just CI related.

I had fixed a similar issue for the new Chat dropdown that would open up at the wrong location via this CSS fix: 48c7be5

So its possible we need to apply this fix to more elements of the titlebar? I also noticed that hovers are not positioned correctly.

@bpasero bpasero added the regression Something that used to work is now broken label Nov 1, 2024
@benibenj benibenj modified the milestone: October 2024 Recovery 2 Nov 4, 2024
@bpasero bpasero added this to the November 2024 milestone Nov 5, 2024
@bpasero bpasero added the important Issue identified as high-priority label Nov 5, 2024
@benibenj
Copy link
Contributor

benibenj commented Nov 5, 2024

There has not been any change in this area on our side and I don't think it is esm related. @deepak1556 any chance the electron update could have caused this?

@deepak1556
Copy link
Collaborator

Was able to confirm this to be a change in the runtime. Traced it back to https://chromium-review.googlesource.com/c/chromium/src/+/5085708 which attempts to adjust the values returned by getBoundingClientRect call to adjust according to the page zoom value. This was behind a feature flag up until Electron 30 and got enabled by default in Electron 32.

The result of it was us double adjusting the menu bar position in

menuHolder.style.left = `${titleBoundingRect.left * titleBoundingRectZoom}px`;
, when this feature is enabled we don't need to manually adjust the rect for zoom values.

I also see there are many callsites of getboundingclientrect apart from the menubar, so maybe this needs a broader adoption in the codebase. What about the following as next steps,

  1. Disable the feature by default using --disable-blink-features="StandardizedBrowserZoom"
  2. Create a meta issue for adopting this adjusted bounding client rect and enable the feature again once adoption is complete ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member important Issue identified as high-priority regression Something that used to work is now broken titlebar VS Code main title bar issues zoom VS Code window zoom issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants