how to stop GUI apps from hanging? #13429
-
I run pycharm from WSL for python interpreter integration It keeps hanging, right click to open a menu -> hang Especially after waking up computer from sleep. I use hibernation and when i wake it up. GUI apps are not visible and they won't restart either. wsl --shutdown and restart sometimes several times a day any tips in which garbage can to throw this laptop into |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
This is a known WSLg + sleep/hibernation quirk. Update WSL/WSLg, avoid hibernation/Fast Startup, and use a quick restart for the WSLg compositor when it gets stuck. If it still happens, grab logs and file it. 1) Update WSL + WSLg
That pulls the latest Store build (which includes WSLg fixes). Launch any distro again and retest. (Docs: Run Linux GUI apps with WSL / update + shutdown.) 2) Why it happensAfter sleep/hibernation the WSLg display stack (Weston/RDP-RAIL) can lose its session, leaving GUI windows frozen or invisible. It’s a long-standing issue discussed in the WSL/WSLg trackers. 3) Quick recovery when GUIs hangA. Fastest: Restart only the WSLg compositor (no full distro shutdown):
Your Linux GUI apps should reappear/launch normally afterwards. (Workaround referenced by WSLg maintainers.) B. Simple (broader reset):
Then start your distro again. 4) Reduce recurrences
5) If you’re using Windows PyCharm with a WSL interpreterThat’s a Windows app (not a WSLg GUI). Hangs after resume usually mean WSL itself got into a bad state — the wsl --shutdown reset above typically clears it. 6) Still broken? Capture info and file it
If this helps, consider marking the answer as accepted so others can find it quickly. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your extensive answer
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the follow-up — sounds like you’ve already ticked most of the big boxes. A few tweaks that usually make hibernate + WSLg more reliable, plus a small quality-of-life reset script. 1) Backpack wake + hibernate hygiene (Windows side)Kill the “mystery wakes” so you can keep hibernation without WSLg getting funky after resume.
This usually stops the “wakes in the backpack” so you don’t need to favor Sleep over Hibernate just to avoid WSLg glitches. 2) One-shot WSLg reset (faster than full shutdown)Since you’re on the Linux PyCharm (WSLg), a stuck compositor is the usual culprit after resume. Make a tiny Windows-side helper so you don’t have to type it each time: PowerShell function (add to your profile):
Or a quick CMD file:
Run it the moment GUIs stop painting; PyCharm should pop back without shutting down your distros. 3) PyCharm (Linux app under WSLg)
4) If it ever persistsNext time it happens, before resetting, grab versions and logs so we can spot a pattern:
Good luck — and nice call switching off Fast Startup. That alone sidesteps a bunch of odd resume states. If this helps, consider marking the answer as accepted so others can find it quickly. |
Beta Was this translation helpful? Give feedback.
-
this does nothing unfortunately |
Beta Was this translation helpful? Give feedback.
Thanks for the follow-up — sounds like you’ve already ticked most of the big boxes. A few tweaks that usually make hibernate + WSLg more reliable, plus a small quality-of-life reset script.
1) Backpack wake + hibernate hygiene (Windows side)
Kill the “mystery wakes” so you can keep hibernation without WSLg getting funky after resume.