WaitPrimitive and batch mode in ROOT 6

Dear all,

I updated my root version from 5.34 to 6.10, but most of my code running in batch mode are no more running properly because now they get stacked when I perform “WaitPrimitive” on a canvas.

Because I generally used TApplication, I tried to specify option “-b”, alternatively to execute the command “gROOT->SetBatch()”, but I obtained the same behavior.

I have also tried with the attached macro that I edited using one of a recent post on a similar problem, but this problem is still present, i.e. if we comment “gROOT->SetBatch()” and double click on TCanvas I get the message from cout, otherwise it is stacked before this message.

I am runnning ROOT 6.10.02 on Debian 9 64 bit with gcc 6.3.0-18.

Thanks for your help

wait.C (207 Bytes)

WaitPrimitive is waiting for a (mouse) event in ta Canvas. In batch mode you have no canvas displayed so no event can occur in it. So “using WaitPrimitive” and "Batch mode"appear to be somehow incompatible.

I just checked that your macro is stuck with ROOT 6 but not with ROOT 5 … I will check what has changed.

Dear couet,

thank you for your reply. Actually, having been a user of ROOT 5 for so long, I have always thought that this behavior was intentional. I found it quite useful because it enables the user to easily switch between non-batch (to make some debug) and batch (to execute long code).

Anyway, I will wait for your investigation.

Yes you are right. It should be working as you expect indeed as it was like that for so long. I am investigating the history of the modifications in that area to make sure I am not changing something which will make an other fixed bug reappears…

I just committed a fix in 6.10 and master. Thanks to have seen it. I will update the doc also.

Thank you, Olivier.

Your help was very quick and effective.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.