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.
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.
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).
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…