# ROOT with WSLg

**URL:** <https://root-forum.cern.ch/t/root-with-wslg/54738>\
**Category:** ROOT\
**Tags:** bug\
**Created:** [May 4, 2023, 4:08pm UTC](https://root-forum.cern.ch/t/root-with-wslg/54738 "2023-05-04T16:08:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![adye](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@adye](https://root-forum.cern.ch/u/adye)\
**Post date:** [May 4, 2023, 4:08pm UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/1 "2023-05-04T16:08:25Z")

</div>

Hi,

As [noted previously](https://root-forum.cern.ch/t/improvements-to-wsl-the-community-may-appreciate/52500), recent versions of WSL (Windows Subsystem for Linux) now support WSLg on both Windows 10 and 11. WSLg allows full GUI support over Weyland or a built-in X11 server. This is a game-changer: no longer do you have to start an X11 server before running ROOT, and it seems to display **much** faster than using a native Windows X11 server.

Displaying output works really nicely and quickly, but unfortunately the ROOT GUI menus are almost unusable. The problem is that the menu pops up on a different part of the screen, detached from its parent. This is definitely a WSLg display problem, because I see the issue whether I run ROOT locally in my (CentOS7 or Ubuntu) WSL distro, or remotely from lxplus (7, 8, or 9) with the X11 tunneling over ssh. I see the same behaviour with ROOT 6.22 and 6.28. On the other hand, I never see this issue using a native Windows X11 server.

This has already been reported as a [WSL issue](https://github.com/microsoft/wslg/issues/671), and similar problems are seen with a few other programs (eg. [kdiff3](https://github.com/microsoft/wslg/issues/459)). The suggestion there is this is a problem with Qt4, and it is resolved with Qt5.

Does ROOT (primarily ROOT built for LCG on CentOS/Alma) use Qt4 for its X11 GUI? Or is there a commonality that could explain why ROOT sees this problem? I’m asking here, because there doesn’t seem to be much activity in fixing the bug in WSL. If the only advice is to “upgrade to Qt5”, then it would be good to have some feedback about whether that (or something analogous) is possible for ROOT.

At the very least we can feed back this information to the WSL github issue. Best of all is if we can come up with a workaround or fix to get ROOT to work with WSLg. (Probably off-topic, but can ROOT use Weyland directly?)

I’m surprised I can’t find more reports of this issue, so just possibly it doesn’t affect everyone. If so, it would be great to hear from anyone for whom the WSLg GUI works correctly. Maybe I (and one or two others) have some setting or installation that can be fixed.

Thanks,  
Tim.

_ROOT Version:_ 6.28/00, 6.22/06  
_Platform:_ x86\_64-centos9, x86\_64-centos7, x86\_64-ubuntu2004  
_Compiler:_ gcc12, gcc11, gcc9

* * *

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [May 4, 2023, 7:00pm UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/2 "2023-05-04T19:00:33Z")

</div>

Check out [this thread](https://root-forum.cern.ch/t/root-on-windows-11-wsl2-wslg/48348), I saw the same over a year ago. In the end I stayed with WSL2 and an X server, and I haven’t tried again WSLg since then.

---

<div class="post-metadata">

**Author:** ![adye](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@adye](https://root-forum.cern.ch/u/adye)\
**Post date:** [May 5, 2023, 10:41am UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/3 "2023-05-05T10:41:21Z")

</div>

Thanks for the pointer. It’s good to know it isn’t just me here. Of course I too still have to use an X server because of this bug. That is a great pity for all the reasons you and I have outlined, and (perhaps saddest of all) makes using ROOT on Windows harder to get going for a new user (the Windows native app is nice, but has troubles of its own).

I hope my post adds the clue about Qt. Even if no one else has a better idea, can the ROOT team confirm whether LCG ROOT uses Qt, what version it is, and what prospects there are for using something else.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [May 5, 2023, 10:50am UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/4 "2023-05-05T10:50:33Z")

</div>

> [@adye](#):
>
> Even if no one else has a better idea, can the ROOT team confirm whether LCG ROOT uses Qt, what version it is, and what prospects there are for using something else.

No, we don’t use Qt.

---

<div class="post-metadata">

**Author:** ![adye](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@adye](https://root-forum.cern.ch/u/adye)\
**Post date:** [May 5, 2023, 10:55am UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/5 "2023-05-05T10:55:41Z")

</div>

Interesting. Does it use another GUI manager, or raw X11 calls? I can follow up on the [github issue I mentioned](https://github.com/microsoft/wslg/issues/671), but of course would be delighted to defer to you.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [May 5, 2023, 10:57am UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/6 "2023-05-05T10:57:16Z")

</div>

It uses `X11` via the `TVirtualX` interface (on Linux)

---

<div class="post-metadata">

**Author:** ![adye](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@adye](https://root-forum.cern.ch/u/adye)\
**Post date:** [May 5, 2023, 11:29am UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/7 "2023-05-05T11:29:58Z")

</div>

Thanks for the pointer.

So if I understand the docs correctly, ROOT’s X11 implementation, [`TGX11`](https://root.cern.ch/doc/v628/classTGX11.html) uses [`GX11Gui.cxx`](https://root.cern.ch/doc/v628/GX11Gui_8cxx_source.html) to handle the GUI. I guess that includes the misplaced menus, but I didn’t yet find anything specific. Is that right?

If no one has a better idea, I guess we can feed this back to the WSL developers.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [May 5, 2023, 11:33am UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/8 "2023-05-05T11:33:37Z")

</div>

> [@adye](#):
>
> So if I understand the docs correctly, ROOT’s X11 implementation, [`TGX11`](https://root.cern.ch/doc/v628/classTGX11.html) uses [`GX11Gui.cxx`](https://root.cern.ch/doc/v628/GX11Gui_8cxx_source.html) to handle the GUI. I guess that includes the misplaced menus, but I didn’t yet find anything specific. Is that right?

Correct. But if it’s a bug in WSLg, I’m not going to invest time in trying to debug it (and I’m mostly working on native Windows anyway)

---

<div class="post-metadata">

**Author:** ![adye](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@adye](https://root-forum.cern.ch/u/adye)\
**Post date:** [May 5, 2023, 5:05pm UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/9 "2023-05-05T17:05:25Z")

</div>

I posted a summary of my understanding of the issue and background on [wslg #671](https://github.com/microsoft/wslg/issues/671#issuecomment-1536534499). Let’s hope with this information, the WSLg experts can help.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 19, 2023, 5:05pm UTC](https://root-forum.cern.ch/t/root-with-wslg/54738/10 "2023-05-19T17:05:41Z")

</div>

Closed on May 19, 2023, 5:05pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
