Windows snapping layouts
Is your feature request related to a problem? Please describe. I have a WSL2 + WSLg on a windows 11 machine I would like to use window snapping layouts with WSL-installed applications
Describe the solution you'd like I would like to use windows snapping layouts when using WSL-installed applications
Describe alternatives you've considered none
Additional context none
Do you mean like some other x11 servers do, x410 for example?
This is for firefox running from wsl2.
Exactly! This is not available for me when using intellij.
Yes, that is why I am using external x server x410 and waiting the same functional from WSLg.
Basically, there is 2 snap UI. The first one is what above comments (https://github.com/microsoft/wslg/issues/727#issuecomment-1119330268), which is at applications title bar. This requires title bar to be rendered by Windows side, and some X server on Windows does support this, but for WSLg, our X11 window manager is in Linux side, thus this will require further changes to support this. Second one, is snap UI slide down from top of Windows's desktop (see below screen shot), this requires local move support in remote desktop protocol, and I'm working on this. However, given this also requires some changes in Window's side RDP client software, it requires some time to be completed, but below is showing the current progress, which xcalc (or any Linux app) can be snapped, thanks!

@hideyukn88 does powertoys fancyzones fall into the second category or would it require it's own separate support?
Yes, that is why I am using external x server x410 and waiting the same functional from WSLg.
@sergju I have X410 but I don't have this feature. what settings do I have to change to get that same functionality?
I have in my ~/bashrc
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0.0
export LIBGL_ALWAYS_INDIRECT=1
@mrconnerton could you explain what your code do?
@mangkoran it grabs the ip from /etc/resolv.conf, which is the wsl ethernet adapter in windows, and uses it to set the X11 display env variable to ip_address:0.0. Honestly I can't remember why I have LIBGL_ALWAYS_INDIRECT set, but I remember having issues without it. So might be optional.
Looking forward to this feature. Has waited for this feature for more than a year.
Yes, that is why I am using external x server x410 and waiting thI e same functional from WSLg.
I can not do this using x410. Can I know what extra setting have you done? @sergju
You just need to create %userprofile%\.wslconfig file with
[wsl2]
guiApplications=false
inside and restart wsl. This will turn off wslg. Thus you can use normal x11 server, such as x410 that support snapping.
You just need to create
%userprofile%\.wslconfigfile with[wsl2] guiApplications=falseinside and restart wsl. This will turn off wslg. Thus you can use normal x11 server, such as x410 that support snapping.
Thanks very much! Suceed! : )
I don't disable wslg to use x410. Just change display variable, but need to change gdk backend to x11. I think without changing backend wsl continues using wslg
export MY_EXT_IP=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}') export DISPLAY=$MY_EXT_IP:0.0 export GDK_BACKEND=x11
Sometimes comment this to check wslg behaviour
I don't disable wslg to use x410. Just change display variable, but need to change gdk backend to x11. I think without changing backend wsl continues using wslg
export MY_EXT_IP=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}') export DISPLAY=$MY_EXT_IP:0.0 export GDK_BACKEND=x11
Sometimes comment this to check wslg behaviour
That's great to only revise files in wsl2. Thanks!
I tried a VcxSrv and yeah, it's working but there are some other issues i'm not gonna deal with.
As already said, I think this is something very related to #22, and in that issue, much older than this one, there hasn't been any update lately. Is there any planning about this functionality?
is anything updates?