wslg
wslg copied to clipboard
CERN ROOT Context Menus flying off to the side on WSl2
Issue
When using CERN Root on WSL2, context menus for visuals are flown off to the side, far from where they should be. For example, the view menu:
The menu behaves as if its where it should be. When mousing over the correct position, the context menu highlights and responds as if its there.
Environment
Windows 11 [Version 10.0.22000.527] Ubuntu 20.04 WSLg 1.0.26 Root 6.24/02
Steps to reproduce
- Install CERN Root on WSL following their instructions https://root.cern/install/
- Open any interface window, for example
[0] TF1 f1("func", "sin(x)/x", 0, 10);
[1] f1.Draw(); //opens graphing window
And attempt to use right-click or file menus
WSL logs:
Same issue happens in REAPER with context menus and the file menus:
First one is the file menu. I guess you can't see my cursor in the 2nd one but it's way left of where the context menu spawned.
Does ROOT use (an old version of) Qt? If so, it's another dupe of https://github.com/microsoft/wslg/issues/459
I'm not a ROOT developer, but am a long-time semi-expert user of ROOT on Linux, Windows, and WSL. I raised this issue on the ROOT forum to see if anyone there had any ideas. Unfortunately not, but I can maybe pass on a bit more information in the hope that it will prompt and help with a fix from the WSLg team.
- The bug is clearly on the WSLg side. I have not seen this problem with other (Unix, Linux, macOS, Windows) X11 servers, going back 25 years. In particular, ROOT running in WSL with a connection to a Windows X-server (Exceed, VcXsrv) works fine.
- ROOT does have a nice native Windows implementation and a (great, but limited) plug-in for VS Code, which maybe explains why there hasn't been more of an immediate clamour for a fix. However ROOT is used in conjunction with an enormous body of software that is almost exclusively available on Linux (or Unix-like/macOS), so being able to use ROOT on WSL would, at least, be much more convenient, and at most be the only alternative to use from a remote server via slow ssh X11 tunneling.
- ROOT does not use Qt (q.v. #459 ). Instead ROOT uses native
Xlib
calls. Since the bug's behaviour is very similar, I guess that whatever feature or assumption that Qt4 is making, ROOT does the same. - ROOT's X11 API implementation is in the
TGX11
class, with most of the low-levelXlib
-using GUI code in one big file, GX11Gui.cxx. - While ROOT continues to be in very active development, the
TGX11
code has been pretty much stable for many years. Clearly the best outcome (for ROOT and Qt4 users) would be for WSLg to implement the menu placement as do other X11 servers. If the problem is identified and a WSLg-specific workaround in ROOT source code were necessary, that might be possible, but given the long deployment time (with other software) for new ROOT versions, this would be far from ideal.
来件已收,祝好。
I have the same problem
I have the same problem, BTW: root doesn't show up clearly on high resolution (eg. 2k) screens
来件已收,祝好。