Graphs and TBrowser not opening

Hi,

I have just start learning root. I used Draw in my code but when i run it i get the error below

Error in TGClient::TGClient: can’t open display “:1”, switching to batch mode…
In case you run from a remote ssh session, reconnect with ssh -Y

Also if i run TBwroser I get simliar error

Error in TGClient::TGClient: can’t open display “:1”, switching to batch mode…
In case you run from a remote ssh session, reconnect with ssh -Y
(TBrowser *) 0x55c67dc937d0

I am not working remotely, i am running it on my laptop.

ROOT Version: 6.22/08
Platform: Ferdora 34
Compiler:gcc 11.1

Can you try xclock?

it says the below

bash: xclock: command not found…
Similar command is: ‘clock’

I just want to know if you can open a graphical Window (like a Web browser for example, or if you only have the problem with ROOT)

I am sorry i am new to linux based system. I dont know how to open web browser from terminal. But i can use gedit from terminal.

Well, then I don’t know, maybe a more advanced Linux user could help… @eguiraud ?

okay. Thanks anyways

Hi,
in the ROOT prompt, what does gROOT->IsBatch() return? E.g. for me:

$ root -l
root [0] gROOT->IsBatch()
(bool) false

same as yours

Ok and then please run in the terminal:

$ echo $DISPLAY

and in the ROOT prompt:

root [0] TBrowser b

and let us know what happens :slight_smile:

Cheers,
Enrico

I am getting this

echo $DISPLAY
:1
TBrowser a                                                                 
Error in <TGClient::TGClient>: can't open display ":1", switching to batch mode...
In case you run from a remote ssh session, reconnect with ssh -Y
(TBrowser &) Name: Browser Title: ROOT Object Browser

Ok your environment says one thing ($DISPLAY is :1) but ROOT does not agree that it’s a valid display.

Can you think of any program or setting in your Linux environment that might mess with the display settings?

We can do a quick and desperate try, running in the terminal: export DISPLAY=:0 and then in the same terminal trying out that ROOT command (for example, just to check what happens).

What value do you have for echo $WAYLAND_DISPLAY

Fedora defaults to Wayland as the display server protocol. ROOT doesn’t have Wayland native support, and should be running with XWayland which is a compatibility shim that lets X11 applications run in Wayland.

It’s likely that this is failing for whatever reason, though I can’t offer much advice as to why, because it should be automatic.

As a workaround, on the Fedora login screen you should be able to select the option to fallback to using X11 entirely, by clicking “GNOME on Xorg”

1 Like

wayland :man_facepalming: thank you @James-Carroll

I am new to Linux and i have only installed required programs. If there is i dont know.

I have tried changing Dislpay it didnt work.

$ echo $WAYLAND_DISPLAY
wayland-0

I have KDE Plasma not Gnome

Yep James is right and you are using the new Wayland display server rather than the classic X11. ROOT does not support Wayland directly, and I’m not sure why the compatibility layer fails in this case. Hopefully some other user might have a suggestion.

Okay.
Thanks anyway

You might try to switch from KDE plasma to GNOME as we have reports of successfully running ROOT + graphics on GNOME + Wayland via XWayland.

I installed Fedora’s KDE spin in a VM, and ROOT seems to work out-of-the-box. I tested both TBrowser and some commands from ROOT: tutorials/graphics/first.C File Reference.

@dpkkumr could you check if your system has Xwayland installed? dnf list installed "*Xwayland*" For me it is and I didn’t add it by hand, so it came installed by default…

1 Like