WCO: compute window control container via CSS variables
Testing #226397
I'm not sure how new this is as it applies to Windows as well. I hadn't noticed until I was using a smaller monitor for Linux.
A good chunk of the blank space in the below image is not draggable.
I am pushing a workaround in https://github.com/microsoft/vscode/pull/226941 for now but the solution is not very good: we hard-code the window-control-container width to a value that probably works best for Windows and our custom controls, but we need to start using the related CSS variables for the real sizes: https://developer.mozilla.org/en-US/docs/Web/CSS/env#titlebar-area-x
One challenge is that on desktop at least, we also need to adjust for native zooming, and in that case I have not gotten the variables to work well, but I also did not try for very long.
One thing to note is that at least on macOS we have seen perf issues in the past when using these variables (https://github.com/microsoft/vscode/issues/165835), but maybe we can get away only using them on just Linux (and optionally Windows if we have to).
Moving out to September where we have to decide how we further polish this item.
Verification:
- enable custom title on Linux
- make sure layout controls are enabled in the custom title
- make sure they appear right next to the (native) window controls