# TCanvas::WaitPrimitive() functionality changed in 6.08/02

**URL:** <https://root-forum.cern.ch/t/tcanvas-waitprimitive-functionality-changed-in-6-08-02/22469>\
**Category:** ROOT\
**Created:** [January 10, 2017, 10:40pm UTC](https://root-forum.cern.ch/t/tcanvas-waitprimitive-functionality-changed-in-6-08-02/22469 "2017-01-10T22:40:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjones](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@pjones](https://root-forum.cern.ch/u/pjones)\
**Post date:** [January 10, 2017, 10:40pm UTC](https://root-forum.cern.ch/t/tcanvas-waitprimitive-functionality-changed-in-6-08-02/22469/1 "2017-01-10T22:40:30Z")

</div>

I have an application that detects mouse events in a TCanvas window to allow users to select certain features in ROOT histograms. The problem appears to be due to a change in the functionality of TCanvas::WaitPrimitive(). In ROOT version 5.34/30, when TCanvas::WaitPrimitive() is called without options, ROOT waits until a double click is detected before continuing. In ROOT version 6.08/02, this functionality appears to have stopped working. I have created a short macro that demonstrates the problem.

```auto
void Wait() {
  TCanvas *c1 = new TCanvas("c1");
  TH1I *h1 = new TH1I("h1","First Histogram",100,1,100);
  TH1I *h2 = new TH1I("h2","Second Histogram",100,1,100);
  h1->Draw();
  c1->Update();
  c1->WaitPrimitive();
  h2->Draw();
}
```

The macro simply creates two histograms, draws the first histogram and then waits for a double click on the Canvas before drawing the second historgram. This works as expected in 5.34/30 but not in 6.08/02. In the most recent version, TCanvas::WaitPrimitive() appears to be ignored and the second histogram is drawn straight away. Has something changed with the way TCanvas::WaitPrimitive() is implemented?

I am working with macOS 10.12 but the problem also occurs on a SL7 Linux box.

Thanks for your help,

Peter

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 11, 2017, 7:41am UTC](https://root-forum.cern.ch/t/tcanvas-waitprimitive-functionality-changed-in-6-08-02/22469/2 "2017-01-11T07:41:47Z")

</div>

I see it too.  
I will check.  
thanks.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 11, 2017, 12:20pm UTC](https://root-forum.cern.ch/t/tcanvas-waitprimitive-functionality-changed-in-6-08-02/22469/3 "2017-01-11T12:20:42Z")

</div>

Now fixed in the ROOT master. Thanks for reporting.
