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

Windows snapping layouts #727

Open
RiccardoManzan opened this issue Apr 29, 2022 · 16 comments
Open

Windows snapping layouts #727

RiccardoManzan opened this issue Apr 29, 2022 · 16 comments
Assignees
Labels
enhancement New feature or request window-management Window management issue

Comments

@RiccardoManzan
Copy link

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

@RiccardoManzan RiccardoManzan added the enhancement New feature or request label Apr 29, 2022
@hideyukn88 hideyukn88 added the window-management Window management issue label May 6, 2022
@sergju
Copy link

sergju commented May 6, 2022

Do you mean like some other x11 servers do, x410 for example?
изображение
This is for firefox running from wsl2.

@RiccardoManzan
Copy link
Author

Exactly!
This is not available for me when using intellij.

@sergju
Copy link

sergju commented May 6, 2022

Yes, that is why I am using external x server x410 and waiting the same functional from WSLg.

@hideyukn88 hideyukn88 self-assigned this May 13, 2022
@hideyukn88
Copy link
Member

hideyukn88 commented May 13, 2022

Basically, there is 2 snap UI. The first one is what above comments (#727 (comment)), 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!

image

@mrconnerton
Copy link

@hideyukn88 does powertoys fancyzones fall into the second category or would it require it's own separate support?

@morphykuffour
Copy link

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?

@mrconnerton
Copy link

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

@mangkoran
Copy link

@mrconnerton could you explain what your code do?

@mrconnerton-encorehc
Copy link

@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.

@crotoc
Copy link

crotoc commented Sep 8, 2022

Looking forward to this feature. Has waited for this feature for more than a year.

@crotoc
Copy link

crotoc commented Sep 8, 2022

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

@eugenov
Copy link

eugenov commented Sep 8, 2022

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.

@crotoc
Copy link

crotoc commented Sep 8, 2022

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.

Thanks very much! Suceed! : )

@sergju
Copy link

sergju commented Sep 9, 2022

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

@crotoc
Copy link

crotoc commented Sep 10, 2022

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!

@RiccardoManzan
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request window-management Window management issue
Projects
None yet
Development

No branches or pull requests

9 participants