microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.19k stars 305 forks source link

CERN ROOT Context Menus flying off to the side on WSl2 #671

Open lab57 opened 2 years ago

lab57 commented 2 years ago

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: image 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

  1. Install CERN Root on WSL following their instructions https://root.cern/install/
  2. 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**: 

[weston.log](https://github.com/microsoft/wslg/files/8135281/weston.log)
[pulseaudio.log](https://github.com/microsoft/wslg/files/8135282/pulseaudio.log)
cdunford commented 2 years ago

Same issue happens in REAPER with context menus and the file menus:

image image

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.

kingosticks commented 2 years ago

Does ROOT use (an old version of) Qt? If so, it's another dupe of https://github.com/microsoft/wslg/issues/459

timadye commented 1 year ago

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.

  1. 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.
  2. 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.
  3. 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.
  4. ROOT's X11 API implementation is in the TGX11 class, with most of the low-level Xlib-using GUI code in one big file, GX11Gui.cxx.
  5. 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.
w1ter-sky commented 1 year ago

来件已收,祝好。

KoljaFrahm commented 1 year ago

I have the same problem

YiHui-Liu commented 7 months ago

I have the same problem, BTW: root doesn't show up clearly on high resolution (eg. 2k) screens

w1ter-sky commented 7 months ago

来件已收,祝好。