Handle wslg windows #45

Closed
opened 2026-01-05 14:47:53 +01:00 by adam · 10 comments
Owner

Originally created by @pigmej on GitHub (Oct 21, 2021).

Originally assigned to: @LGUG2Z on GitHub.

In recent WSL2 stuff, you can use WSLg to have UI support out of the box. Sadly these windows are currently completely not managed by komorebi (they stay on the screen regardless of the desktop and they float).

That's the window info from AHK Window Spy.

Untitled File 1 - gedit (Arch)
ahk_class RAIL_WINDOW
ahk_exe mstsc.exe
ahk_pid 15564

(it's similar to #52 )

Originally created by @pigmej on GitHub (Oct 21, 2021). Originally assigned to: @LGUG2Z on GitHub. In recent WSL2 stuff, you can use WSLg to have UI support out of the box. Sadly these windows are currently completely not managed by komorebi (they stay on the screen regardless of the desktop and they float). That's the window info from AHK Window Spy. ``` Untitled File 1 - gedit (Arch) ahk_class RAIL_WINDOW ahk_exe mstsc.exe ahk_pid 15564 ``` (it's similar to #52 )
adam added the enhancement label 2026-01-05 14:47:53 +01:00
adam closed this issue 2026-01-05 14:47:53 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Oct 21, 2021):

I don't have a build of windows that supports WSLg at the moment. Can you run the AHK script below and share the WindowStyle and WindowExStyle output for a WSLg app? This will help me narrow down why it is being excluded by the current window management logic.

https://www.computoredge.com/AutoHotkey/Downloads/CheckStyles.ahk

@LGUG2Z commented on GitHub (Oct 21, 2021): I don't have a build of windows that supports WSLg at the moment. Can you run the AHK script below and share the WindowStyle and WindowExStyle output for a WSLg app? This will help me narrow down why it is being excluded by the current window management logic. https://www.computoredge.com/AutoHotkey/Downloads/CheckStyles.ahk
Author
Owner

@pigmej commented on GitHub (Oct 21, 2021):

That would be that:
2021-10-21_17-55

@pigmej commented on GitHub (Oct 21, 2021): That would be that: <img width="231" alt="2021-10-21_17-55" src="https://user-images.githubusercontent.com/496754/138313933-898c3096-478b-4a75-a88a-b0413a011bcb.png">
Author
Owner

@LGUG2Z commented on GitHub (Oct 21, 2021):

Can you post the results from the WindowExStyle tab as well? I can already see that WS_CAPTION is not set on these windows, which is used by komorebi to decide to manage a window.

Can you also check if other WSLg apps have the same ahk_class and ahk_exe?

@LGUG2Z commented on GitHub (Oct 21, 2021): Can you post the results from the WindowExStyle tab as well? I can already see that `WS_CAPTION` is not set on these windows, which is [used by komorebi to decide to manage a window](https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/window.rs#L277). Can you also check if other WSLg apps have the same ahk_class and ahk_exe?
Author
Owner

@pigmej commented on GitHub (Oct 21, 2021):

Will do a bit later today. Like plus 30mins or so.

@pigmej commented on GitHub (Oct 21, 2021): Will do a bit later today. Like plus 30mins or so.
Author
Owner

@LGUG2Z commented on GitHub (Oct 21, 2021):

I have just tried launching gedit through vcxsrv and I see the same behaviour. WS_CAPTION and WS_EX_WINDOWEDGE are both not set on the window, which is what is causing them to not be managed. I believe that if we have a whilelist of exe files that are used for launching Linux GUI apps, we can override the caption and window edge requirements for managing windows by default.

So far I can think of:
vcxsrv.exe - what I think a lot of people used before WSLg was a thing
mstsc.exe - what is used by WSLg

If there are any other overwhelmingly common processes used for remotely displaying Linux GUI apps, they can be added to a default list too.

Ultimately, I think that the way forward is to allow each user to be able to configure via komorebic one or more processes that they use for remotely displaying Linux GUIs from WSL2, with a bunch of sane defaults (like for WSLg) built in.

@LGUG2Z commented on GitHub (Oct 21, 2021): I have just tried launching `gedit` through `vcxsrv` and I see the same behaviour. `WS_CAPTION` and `WS_EX_WINDOWEDGE` are both not set on the window, which is what is causing them to not be managed. I believe that if we have a whilelist of exe files that are used for launching Linux GUI apps, we can override the caption and window edge requirements for managing windows by default. So far I can think of: `vcxsrv.exe` - what I think a lot of people used before WSLg was a thing `mstsc.exe` - what is used by WSLg If there are any other overwhelmingly common processes used for remotely displaying Linux GUI apps, they can be added to a default list too. Ultimately, I think that the way forward is to allow each user to be able to configure via komorebic one or more processes that they use for remotely displaying Linux GUIs from WSL2, with a bunch of sane defaults (like for WSLg) built in.
Author
Owner

@pigmej commented on GitHub (Oct 21, 2021):

They all have the same class. All the same, mostly title changes and that's It.

2021-10-21_21-05
@pigmej commented on GitHub (Oct 21, 2021): They all have the same class. All the same, mostly title changes and that's It. <img width="254" alt="2021-10-21_21-05" src="https://user-images.githubusercontent.com/496754/138340964-21db61ed-3860-4a7e-8e28-12b3b5f31173.png">
Author
Owner

@LGUG2Z commented on GitHub (Oct 21, 2021):

Linux GUI apps run with VcXsrv, WSLg and X410 will now be tiled by default. 🎉

@LGUG2Z commented on GitHub (Oct 21, 2021): Linux GUI apps run with VcXsrv, WSLg and X410 will now be tiled by default. 🎉
Author
Owner

@pigmej commented on GitHub (Oct 22, 2021):

Works good! :)

@pigmej commented on GitHub (Oct 22, 2021): Works good! :)
Author
Owner

@pigmej commented on GitHub (Oct 29, 2021):

@LGUG2Z same happens as in #52 currently.

@pigmej commented on GitHub (Oct 29, 2021): @LGUG2Z same happens as in #52 currently.
Author
Owner

@markgeejw commented on GitHub (Jul 16, 2022):

WSLg applications still seem to have issues. WSLg preview is now using msrdc.exe. I tried updating the array, but it still wasn't managing the WSLg window. Works with vcxsrv though!

When I manually manage the WSLg window, there seems to be issues with how komorebi tiles the window. The size of the window can only change by using the cursor to drag the edges. I think it has to do with how WSLg is handling window sizing server-side, according to microsoft/wslg#22

@markgeejw commented on GitHub (Jul 16, 2022): WSLg applications still seem to have issues. WSLg preview is now using msrdc.exe. I tried updating the array, but it still wasn't managing the WSLg window. Works with vcxsrv though! When I manually manage the WSLg window, there seems to be issues with how komorebi tiles the window. The size of the window can only change by using the cursor to drag the edges. I think it has to do with how WSLg is handling window sizing server-side, according to microsoft/wslg#22
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#45