microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.25k stars 307 forks source link

Dynamically change WSLg display size according to Windows host screen size #1281

Open GhostScript0r opened 2 months ago

GhostScript0r commented 2 months ago

Is your feature request related to a problem:

When the resolution of main display changed, WSLg won't recognize the screen size change. As a result, maximized WSLg windows would be the size of the screen when WSL last started.

This issue is prominent when I access my Windows PC remotely. On my guest PC I have a horizontal and a vertical monitor. If I start WSL when the RDP window is on the horizontal monitor and move the RDP window to the vertical monitor. The WSLg windows will still be the size of the horizontal monitor when maximized:

image

Describe the solution you'd like:

WSLg shall be able to recognize the current screen resolution real-time and not require a WSL restart to change the shape of the maximized window.

Describe alternatives you've considered:

Using Xvnc or Xrdp instead of WSLg. But those solutions will be cumbersome.

Additional context:

No response