vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Maximize/restore button is not responsive when Window Controls Overlay is enabled

Open johningve opened this issue 3 years ago • 10 comments

Type: Bug

After updating to vscode 1.71.0, the Window Controls Overlay (WCO) becomes enabled by default, and the maximize/restore button no longer responds to hover / clicks. The button works when WCO is disabled.

Video:

ezgif-5-34c5d188ea

VS Code version: Code 1.71.0 (784b0177c56c607789f9638da7b6bf3230d47a8c, 2022-09-01T07:36:10.600Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No Remote OS version: Linux x64 5.15.57.1-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 9 5900HS with Radeon Graphics (16 x 3294)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.41GB (5.67GB free)
Process Argv --folder-uri vscode-remote://wsl%2Bubuntu/home/johnio/src/pos/snarl-proof-of-storage --crash-reporter-id cf5aa43a-260d-4000-ac8c-44c35a376e15
Screen Reader no
VM 44%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.57.1-microsoft-standard-WSL2
CPUs AMD Ryzen 9 5900HS with Radeon Graphics (16 x 3293)
Memory (System) 7.47GB (6.44GB free)
VM 0%
Extensions (34)
Extension Author (truncated) Version
language-gas-x86 bas 0.0.2
vscode-drawio hed 1.6.4
discord-vscode icr 5.8.0
better-cpp-syntax jef 1.15.19
remote-containers ms- 0.251.0
remote-ssh ms- 0.84.0
remote-ssh-edit ms- 0.80.0
remote-wsl ms- 0.66.3
rewrap stk 1.16.3
vim vsc 1.23.2
vscode-markdownlint Dav 0.48.1
vscode-new-file dku 4.0.2
gitlens eam 12.2.1
copilot Git 1.43.6621
vscode-pull-request-github Git 0.50.0
go gol 0.35.2
todo-tree Gru 0.0.215
latex-workshop Jam 8.29.0
plantuml jeb 2.17.3
better-cpp-syntax jef 1.15.19
serenity-dsl-syntaxhighlight kle 0.2.1
cpptools ms- 1.12.4
wordcount ms- 0.1.0
rust-analyzer rus 0.3.1186
crates ser 0.5.10
comment-divider sta 0.4.0
even-better-toml tam 0.18.1
latex-utilities tec 0.4.6
shellcheck tim 0.21.4
cmake twx 0.0.17
vscode-lldb vad 1.7.4
markdown-all-in-one yzh 3.4.3
grammarly znc 0.22.1
vscode-proto3 zxh 0.5.5

(4 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30557514
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
pylanb8912:30545647
vsclangdf:30486550
c4g48928:30535728
hb751961:30553087
dsvsc012:30540252
azure-dev_surveyone:30548225
2144e591:30553903

johningve avatar Sep 02 '22 07:09 johningve

I have the same problem on Windows 11.

tdjastrzebski avatar Sep 06 '22 21:09 tdjastrzebski

I'm unable to reproduce the issue on Windows 10 + Ubuntu WSL. Added Windows 11 label.

rzhao271 avatar Sep 06 '22 22:09 rzhao271

It turns out that win_caption_button_container.cc in electron/electron has some code that disables the maximize/restore button when touch mode is enabled. is_touch is determined by touch_ui in Chromium, which is determined partially by IsWindows10OrGreaterTabletMode in Chromium. There's also a comment in the last link about the Surface 4 always returning tablet mode.

I'm curious whether you are using a tablet, or whether Chromium thinks you are using a tablet (or in tablet mode) when you're not actually using one?

rzhao271 avatar Sep 07 '22 18:09 rzhao271

I'm curious whether you are using a tablet, or whether Chromium thinks you are using a tablet (or in tablet mode) when you're not actually using one?

That appears to be the issue! My laptop (Asus Flow X13) has a touch screen with a 360 degree hinge (like the Lenovo Yoga laptops). I typically have it standing on my desk in "tent mode" where the screen is folded almost all the way to the back, like this: ∧

When I folded it back and used it as a normal laptop, the maximize/restore button functions as expected.

johningve avatar Sep 08 '22 06:09 johningve

Thanks for confirming the issue, this is same as https://bugs.chromium.org/p/chromium/issues/detail?id=1338572. Electron should allow the window to be maximized if the window is not already maximized when changing to tablet mode.

deepak1556 avatar Sep 08 '22 06:09 deepak1556

This bug has been fixed in the latest release of VS Code Insiders!

@johningve, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 8b9891739b703b50547f506a7e2bc9565e52beff of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

vscodenpa avatar Nov 29 '22 17:11 vscodenpa

I'm on the newest version of insiders on Windows 11 and I'm still getting this error

Recording 2022-11-30 at 15 48 15

I'm trying to click, but the window isn't changing.

andreamah avatar Nov 30 '22 23:11 andreamah

@andreamah were you testing on a touch device ?

deepak1556 avatar Dec 08 '22 09:12 deepak1556

I can also repro the issue on Windows 11 while in tablet mode.

rzhao271 avatar Dec 08 '22 17:12 rzhao271

@andreamah were you testing on a touch device ?

Yeah! Interesting, I tested on a surface laptop studio in "stage mode", so I guess that counts as a tablet mode?

andreamah avatar Dec 08 '22 17:12 andreamah

I just tested this issue again. The issue is not fixed with the exploration build, but it is potentially as-designed. When restored (unmaximized), one is able to maximize the window. After the window has been maximized, one cannot restore it. This behaviour actually lines up with Chrome, because Chrome completely disables the restore button while in touch mode after the user maximizes it. The minimize and close buttons are still available. On Edge, one can maximize and restore the window while in touch mode. I find this behaviour more intuitive.

rzhao271 avatar Jan 23 '23 18:01 rzhao271

@rzhao271 the original issue is about maximize button not working when entering touch mode which has been addressed. As for aligning the restore behavior either with edge or chrome should be a separate issue, also this needs discussion in upstream electron.

deepak1556 avatar Feb 21 '23 12:02 deepak1556

In that case, closing this issue as verified

rzhao271 avatar Feb 21 '23 17:02 rzhao271