Location of dropdown menu from TCanvas and context info displaced


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: 6.40.02
Platform: Ubuntu 24-04 (under Windows 11 wsl)
Compiler: gcc 13.3


Hi,

I have a new laptop and when I use the dropdown menu of a TCanvas (or some context menu in a GUI) the produced text doesn’t appear at the point where I clicked, but appears at a random location on my screen. Is there a way to get this fixed (e.g. by some setting in ROOT) ?

Cheers,

Nick.

Also … the text in the ROOT windows (e.g. TBrowser, the menus in TCanvas etc.) is very small. How can I make the text in these windows larger? It seems that gStyle->SetTextFont() and gStyle->SetTextSize() are not available anymore.

That’s been an issue for several years already, and it seems that it won’t be solved; it seemed to be working at first with the method I showed in my posts below, but then it stopped working again. Maybe running ROOT in a browser (with the option --web=on) will bypass the issue, but I haven’t used ROOT on WSL for a while so I’m not sure.

Strange indeed. However, I can click on the produced menu items, but it is very inconvenient.

On my old laptop running ROOT 6.24.08 under Ubuntu 18 in a windows powershell, everything works well. But that screen has a different resolution, so maybe it is related to that.

By the way: Is there a way that I can increase the fontsize for the text of ROOT objects, like the Browser, the menu items in TCanvas etc. ? As I mentioned before, the gStyle->SetTextFont() and gStyle->SetTextSize() are not available anymore as far as I can see.

Cheers,

Nick.

Check out similar threads in the forum, e.g.

though those are not necessarily for WSL, but might work.

Thanks for the hints. Now I can indeed change the fonts in .rootc via setting Gui.DefaultFont etc.

But … when I have a canvas and open the editor via its dropdown menu, it seems that the window is not correctly scaled for the now larger font, so that there appears a horizontal slider bar in the editor. This is also quite annoying. Is there any setting such that when the font is larger, either the window is enlarged accordingly, or the window stays the same size, but the canvas size is reduced (in the horizontal direction) such that all the text is visible in the editor pane. The same holds for FitPanel etc.

A ROOT developer may correct me, but as far as I know there isn’t such setting. Maybe you could try to change the Windows screen resolution, although that may not be optimal (or may not affect these windows at all); from what I found, it seems that it’s not a problem of ROOT itself (as the issues also happen with other software under WSL) but of the graphics widgets (GTK, I guess), or even the X system. Again, using the web interface should bypass these issues, if it works with WSL (I haven’t tried it).

Okido, I will try to use the web interface. How can I activate the web interface ?

ps. The mislocation of the dropdown menus might be related to a mismatch of the screen resolution between the regular Windows 11 screen and the produced WSL Ubuntu screen. However, I don’t see a way (yet) to modify the Ubuntu screen resolution without changing the regular Windows 11 screen resolution. The latter I don’t want to change, since that will affect all other applications and will make a mess.

This has been fixed in master. See this PR and this commit

Hi Bertrand,

Great! Does that mean that with the following (patch) release of ROOT 6.40 it will be fixed? I am using the binary ROOT distribution for my Ubuntu system.

No, it will be in the next release (6.42)

Okido, all clear. Don’t take too long to get it out :wink:

I’ll check if I can backport it in the next 6.40 patch release…

In the meantime, if you want to run the web interface, first install a browser inside Ubuntu (Firefox seems to work well, sudo apt install firefox), then just run root and create a TBrowser; by default (if you don’t have the option --web=off in a .rootrc file) it should open in a web browser window (or start root with root --web=on), and will tell you the URL for the HTTP server --which only works inside this WSL Ubuntu, that’s why you need to install the browser in it.

That would be very much appreciated !

Can I toggle between the web and standard rendering via setting Browser.Name and Canvas.Name in my .rootrc file, so that I can always go back to the old situation if something goes wrong? And should I then also set Browser.StartUrl to the URL that the system will tell me?

If I switch on that the editor (and event status) is switched on by default, the TBrowser window is correctly scaled such that the large character text is completely displayed. Probably this is because in the TBrowser one can resize the canvas window with the slider. However, this “sliding window” is not implemented in TCanvas (and also not in e.g. the FitPanel window), so it won’t work for these. Would it be possible to also scale these windows w.r.t. the selected text font size?

Yes, you can. For the web-based implementations:

Browser.Name:  ROOT::RWebBrowserImp
Canvas.Name:   TWebCanvas

For classical UI:

Browser.Name:  TRootBrowser
Canvas.Name:   TRootCanvas

Side note: you can natively install ROOT 6.40 on Windows without needing a WSL with Ubuntu, just VScode 2022.

Hi Sergey,

Thanks for the info. I have installed Firefox and this works. However, the web based facility is a bit limited in functionality compared to the ROOT based one. So, when ROOT gets fixed for the dropdown menus I tend to stick with the ROOT option, but that might be a matter of taste of course.

Quite some time ago I indeed was using ROOT directly under windows, but my experience is that the functionality under Linux is better, so I made the switch.