diff --git a/gui/webdisplay/inc/ROOT/TWebWindow.hxx b/gui/webdisplay/inc/ROOT/TWebWindow.hxx index b6aca0f04f3ee4bc18cd259c315eac9d487786cc..f628b9bd5720ea46afd6fb0e93256e0b4b51447e 100644 --- a/gui/webdisplay/inc/ROOT/TWebWindow.hxx +++ b/gui/webdisplay/inc/ROOT/TWebWindow.hxx @@ -210,6 +210,8 @@ public: void Sync(); + void Run(double tm = 0.); + bool Show(const std::string &where = ""); bool CanSend(unsigned connid, bool direct = true); diff --git a/gui/webdisplay/inc/ROOT/TWebWindowsManager.hxx b/gui/webdisplay/inc/ROOT/TWebWindowsManager.hxx index 50c015ec3933173d0b25be898c90eccb05a51034..445c221975fa7775c33bcbb6b1ccdd69becc478c 100644 --- a/gui/webdisplay/inc/ROOT/TWebWindowsManager.hxx +++ b/gui/webdisplay/inc/ROOT/TWebWindowsManager.hxx @@ -44,9 +44,9 @@ private: std::string fAddr; ///<! HTTP address of the server std::mutex fMutex; ///<! main mutex to protect int fMutexBooked{0}; ///<! flag indicating that mutex is booked for some long operation - std::thread::id fBookedThrd; ///<! thread where mutex is booked, can be reused + std::thread::id fBookedThrd; ///<! thread where mutex is booked, can be reused + unsigned fIdCnt{0}; ///<! counter for identifiers // std::list<std::shared_ptr<TWebWindow>> fDisplays; ///<! list of existing displays (not used at the moment) - unsigned fIdCnt{0}; ///<! counter for identifiers bool CreateHttpServer(bool with_http = false); diff --git a/gui/webdisplay/src/TWebWindow.cxx b/gui/webdisplay/src/TWebWindow.cxx index 519975de2c07bb554fd8fae32dd3712453db3998..ae915ec25108efe2db2f3cc1cdad4d78e1e64a62 100644 --- a/gui/webdisplay/src/TWebWindow.cxx +++ b/gui/webdisplay/src/TWebWindow.cxx @@ -773,3 +773,16 @@ int ROOT::Experimental::TWebWindow::WaitFor(WebWindowWaitFunc_t check, double ti { return fMgr->WaitFor(*this, check, timelimit); } + +///////////////////////////////////////////////////////////////////////////////// +/// Run window functionality for specified time +/// If no action can be performed - just sleep specified time + +void ROOT::Experimental::TWebWindow::Run(double tm) +{ + if (tm <= 0) { + Sync(); + } else { + WaitFor([](double) { return 0; }, tm); + } +}