Skip to content

Conversation

silverweed
Copy link
Contributor

Similarly to #19305 with rootls, this PR replaces rootbrowse.py with a native version.
Since rootbrowse is just a thin wrapper over TBrowser, this change is much smaller than for rootls and should be quite straightforward.

NOTE: the new rootbrowse is currently untested on Windows and Mac, so before merging this I would much appreciate if someone could help me with that.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

options:
-h, --help show this help message and exit
-w, --web WEB Configure webdisplay. For all possible values, see:
https://root.cern/doc/v636/classTROOT.html#a1749472696545b76a6b8e79769e7e773
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there is a way to point to the latest doc consistently...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great! Or this string needs to be updated as part of the release procedure

Copy link
Member

@pcanal pcanal Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://root.cern/doc/master/classTROOT.html#a1749472696545b76a6b8e79769e7e773

works (maybe, I am not sure how stable the hash is).
@dpiparo It would also be nice if

https://root.cern/doc/latest-stable/classTROOT.html#a1749472696545b76a6b8e79769e7e773

worked ...

PS. Apologies to @ferdymercury who already proposed this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Danilo we decided we will do this, however we need a good way to make it obvious which version a user is looking at, and not just "latest-stable". This will probably need a little work on the website js - I will do it as soon as I manage.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not doing it on the c++ side or even CMake side? since R__VERSION_MAJOR is known, we can decide whether the help prints:
v636 or v634 or master, etc.
For non-even dev versions, either "master" or round-up to even number.
This could be a generic CMake or C++ function that would be useful for everybody, not just rootbrowse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't hate the idea of having a latest-stable link, regardless of what we decide to do with this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

github-actions bot commented Aug 22, 2025

Test Results

    21 files      21 suites   4d 0h 57m 15s ⏱️
 3 644 tests  3 491 ✅  0 💤 153 ❌
74 774 runs  74 598 ✅ 23 💤 153 ❌

For more details on these failures, see this check.

Results for commit b717f19.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

options:
-h, --help show this help message and exit
-w, --web WEB Configure webdisplay. For all possible values, see:
https://root.cern/doc/v636/classTROOT.html#a1749472696545b76a6b8e79769e7e773
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great! Or this string needs to be updated as part of the release procedure

Copy link
Member

@dpiparo dpiparo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reporting from my MacOS 15 machine:

  • calling rootbrowse by default starts the webgui, which just hangs and does not produce anything on screen:
08:56:03 (rootdev) vpadulan@vpadulan-macbook rootproject → rootbrowse

ROOT comes with a web-based browser, which is now being started.
Revert to TBrowser by setting "Browser.Name: TRootBrowser" in rootrc file or
by starting "root --web=off"
Find more info on https://root.cern/for_developers/root7/#rbrowser
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:8846
Press ctrl+c to exit.
  • setting "Browser.Name: TRootBrowser" in rootrc does not work, rootbrowse does not pick up the option and still tries to start the web graphics

@linev the fact that the web graphics hang on MacOS is troublesome

@linev
Copy link
Member

linev commented Aug 26, 2025

@linev the fact that the web graphics hang on MacOS is troublesome

@vepadulano I see no problem on my Mac with master branch.

root --web=safari -e 'new TBrowser'  

or

root --web=safari -e 'new TBrowser'  

It is troublesome that simple commands is not know to everybody.

@vepadulano
Copy link
Member

What command do you mean specifically? I'm just testing rootbrowse as it is the main goal of this PR

Comment on lines 120 to 123
// NOTE: we need to instantiate TApplication ourselves, otherwise TBrowser
// will create a batch application that cannot show graphics.
TApplication app("rootbrowse", nullptr, nullptr);

Copy link
Collaborator

@ferdymercury ferdymercury Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment on why I never use rootbrowse:
You sometimes come to a point where you would like to type something in the terminal and you cannot.

My question: wouldn't it be easier to just call, as an alias:
root -l %arg1 --web=%arg2 -e 'auto br = new TBrowser;'

rather than creating a TApplication ?

Or, alternatively, create a TRint instead of a TApplication, as in rmain.cxx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this would indeed be a better option. Begs the question why it wasn't done like that so far though - if there are reasons for it I am not aware of them...

@linev
Copy link
Member

linev commented Aug 26, 2025

@vepadulano

Old rootbrowse based on python. And ROOT graphics - classical one and web-based - does not work reliably on mac with python.

There is PR which provides reasonable solution for python on all platforms - including Windows and Mac.
PR is #17587

It is pending since January.

@silverweed
Copy link
Contributor Author

@linev Vincenzo was referring to this version of rootbrowse, so Python is not involved. We later found that the web graphics was not actually "hanging", but rather opening a window in another desktop without moving automatically to it - this is obviously better than hanging, but still not a great experience for a user. Is it expected to do that or should the web window also get focused automatically (like the classic graphics do)?

@linev
Copy link
Member

linev commented Aug 26, 2025

Is it expected to do that or should the web window also get focused automatically (like the classic graphics do)?

I do not have control over desktop applications when starting external browser via the shell functionality.
Each desktop manager like KDE or Gnome or Windows or Mac have its own methods to control this.
The only exception is use of CEF or Qt6 WebEngine - but they sometime have other problems and normally not present on the system

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my MacOS ARM laptop, works with both traditional graphics and web graphics, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants