From efabb25073193418aa8173384bfea5885cdbef03 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 17 Oct 2023 08:34:30 +0200 Subject: [PATCH] [webcanvas] make default off for the TWebCanvas Only when explicitly --web option specified web canvas will be used --- cmake/modules/RootConfiguration.cmake | 4 ++-- core/base/src/TROOT.cxx | 5 ++--- gui/gui/src/TRootGuiFactory.cxx | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 97445596e7ace..9d550873c6f5b 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -508,13 +508,13 @@ if(NOT HARDWARE_INTERF_COMPILE OR NOT HARDWARE_INTERF_RUN EQUAL 0) set(hardwareinterferencesize 64) endif() +set(root_canvas_class "TRootCanvas") + if(webgui) - set(root_canvas_class "TWebCanvas") set(root_treeviewer_class "RTreeViewer") set(root_geompainter_type "web") set(root_jupyter_jsroot "on") else() - set(root_canvas_class "TRootCanvas") set(root_treeviewer_class "TTreeViewer") set(root_geompainter_type "root") set(root_jupyter_jsroot "off") diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx index 85edbf60201a8..d054d4de4b0c4 100644 --- a/core/base/src/TROOT.cxx +++ b/core/base/src/TROOT.cxx @@ -2999,7 +2999,6 @@ void TROOT::SetWebDisplay(const char *webdisplay) const char *wd = webdisplay ? webdisplay : ""; // store default values to set them back when needed - static TString canName = gEnv->GetValue("Canvas.Name", ""); static TString brName = gEnv->GetValue("Browser.Name", ""); static TString trName = gEnv->GetValue("TreeViewer.Name", ""); static TString geomName = gEnv->GetValue("GeomPainter.Name", ""); @@ -3033,9 +3032,9 @@ void TROOT::SetWebDisplay(const char *webdisplay) } if (fIsWebDisplay) { - // restore canvas and browser classes configured at the moment when gROOT->SetWebDisplay() was called for the first time + // restore browser classes configured at the moment when gROOT->SetWebDisplay() was called for the first time // This is necessary when SetWebDisplay() called several times and therefore current settings may differ - gEnv->SetValue("Canvas.Name", canName); + gEnv->SetValue("Canvas.Name", "TWebCanvas"); gEnv->SetValue("Browser.Name", brName); gEnv->SetValue("TreeViewer.Name", trName); gEnv->SetValue("GeomPainter.Name", geomName); diff --git a/gui/gui/src/TRootGuiFactory.cxx b/gui/gui/src/TRootGuiFactory.cxx index 410ff3d28416c..2bd31a911089f 100644 --- a/gui/gui/src/TRootGuiFactory.cxx +++ b/gui/gui/src/TRootGuiFactory.cxx @@ -77,7 +77,7 @@ void TRootGuiFactory::ShowWebCanvasWarning() TCanvasImp *TRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height) { - TString canvName = gEnv->GetValue("Canvas.Name", "TWebCanvas"); + TString canvName = gEnv->GetValue("Canvas.Name", "TRootCanvas"); if (canvName == "TWebCanvas") { auto ph = gROOT->GetPluginManager()->FindHandler("TCanvasImp", "TWebCanvas"); @@ -97,7 +97,7 @@ TCanvasImp *TRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, TCanvasImp *TRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height) { - TString canvName = gEnv->GetValue("Canvas.Name", "TWebCanvas"); + TString canvName = gEnv->GetValue("Canvas.Name", "TRootCanvas"); if (canvName == "TWebCanvas") { auto ph = gROOT->GetPluginManager()->FindHandler("TCanvasImp", "TWebCanvas");