# Button clicked issue with juce 1.54.27

**URL:** <https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749>\
**Category:** Audio Plugins\
**Created:** [November 21, 2011, 10:56am UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749 "2011-11-21T10:56:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RiphRaph](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@RiphRaph](https://forum.juce.com/u/RiphRaph)\
**Post date:** [November 21, 2011, 10:56am UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/1 "2011-11-21T10:56:34Z")

</div>

I just updated my juce library from 1.53.94 to 1.54.27 and i noticed that ButtonClicked is no longer called on Reaper 64. [latest version 4.12, on Mac OSX 10.6]  
It must come from the Component::isMouseOver() function that used to return true before and that returns false now.

Version 1.53.94:

[code]bool Component::isMouseOver (const bool includeChildren) const  
{  
if (flags.mouseOverFlag)  
return true;

```
if (includeChildren)
{
    Desktop& desktop = Desktop::getInstance();

    for (int i = desktop.getNumMouseSources(); --i >= 0;)
    {
        Component* const c = desktop.getMouseSource(i)->getComponentUnderMouse();

        if (isParentOf (c) && c->flags.mouseOverFlag) // (mouseOverFlag checked in case it's being dragged outside the comp)
            return true;
    }
}

return false;

```

}  
[/code]

Version 1.54.27:

[code]//==============================================================================  
bool Component::isMouseOver (const bool includeChildren) const  
{  
const Desktop& desktop = Desktop::getInstance();

```
for (int i = desktop.getNumMouseSources(); --i >= 0;)
{
    const MouseInputSource* const mi = desktop.getMouseSource(i);

    Component* const c = mi->getComponentUnderMouse();

    if ((c == this || (includeChildren && isParentOf (c)))
          && c->reallyContains (c->getLocalPoint (nullptr, mi->getScreenPosition()), false))
        return true;
}

return false;

```

}[/code]

reallyContains should return true but doesn’t, consequently none of my buttons work… so it’s a bit annoying.

In Cubase 32 or 64 bit and Repaer 32-bit, it works though. Very odd

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 21, 2011, 11:21am UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/2 "2011-11-21T11:21:01Z")

</div>

Very odd. Maybe they’re buggering-about with the view coordinates or something?

Can you see whether it’s reallyContains() that’s failing, or whether it’s just being given the wrong coordinates to check?

---

<div class="post-metadata">

**Author:** ![RiphRaph](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@RiphRaph](https://forum.juce.com/u/RiphRaph)\
**Post date:** [November 21, 2011, 4:02pm UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/3 "2011-11-21T16:02:03Z")

</div>

It seems to me that the coordinates checked in reallyContains are wrong.  
When i check twice the coordinates for a same button, the values are completly different.  
So I guess they are relative to something but not to the component.

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [December 4, 2011, 10:07am UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/4 "2011-12-04T10:07:48Z")

</div>

I confirm the issue with reaper 64-bit on macos – it happens only with the VST, not with the 64-bit audio unit.

The Y coordinate of the localpoint computed in Component::isMouseOver seems to be false:

Button::mouseDown: x=123 8  
Component::isMouseOver: getScreenPosition=1485 155 -\> localPoint: 123 34 -\> reallyContains: 0

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 4, 2011, 10:38am UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/5 "2011-12-04T10:38:12Z")

</div>

Hmm, sounds like it’s being offset by the size of a title bar… I think I may actually have changed the way it converts global-\>local coords since 1.54 though - could be worth trying the modules branch in case this is already sorted.

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [December 4, 2011, 4:40pm UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/6 "2011-12-04T16:40:28Z")

</div>

Oh I forgot to mention it, but I tested with the latest modules branch, so the issue is still there

---

<div class="post-metadata">

**Author:** ![Harrie\_Munnik](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/harrie_munnik/32/2707_2.png) [@Harrie\_Munnik](https://forum.juce.com/u/Harrie_Munnik)\
**Post date:** [January 9, 2012, 5:16pm UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/7 "2012-01-09T17:16:14Z")

</div>

Is this one sorted out? I have the same issue with my 64 bits VST version of my plugin.

Harrie

---

<div class="post-metadata">

**Author:** ![valhalladsp](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/valhalladsp/32/71_2.png) [@valhalladsp](https://forum.juce.com/u/valhalladsp)\
**Post date:** [January 9, 2012, 11:31pm UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/8 "2012-01-09T23:31:57Z")

</div>

[quote=“Harrie Munnik”]Is this one sorted out? I have the same issue with my 64 bits VST version of my plugin.  
[/quote]

I just tell people to use the 64-bit AU, which works reasonably stable in Reaper 64/OSX.

Sean Costello

---

<div class="post-metadata">

**Author:** ![RiphRaph](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@RiphRaph](https://forum.juce.com/u/RiphRaph)\
**Post date:** [February 3, 2012, 4:31pm UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/9 "2012-02-03T16:31:40Z")

</div>

No, it’s not!  
I updated my Juce library to 2.0.16, and the problem is still there!  
I hoped it would be ok by now!  
It’s been more than two months that I noticed it.  
Hey Jules, are you planning to fix it soon ?

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [February 3, 2012, 4:37pm UTC](https://forum.juce.com/t/button-clicked-issue-with-juce-1-54-27/7749/10 "2012-02-03T16:37:36Z")

</div>

Probably related to this

[http://www.rawmaterialsoftware.com/viewtopic.php?t=8506&p=48205#p48205](http://www.rawmaterialsoftware.com/viewtopic.php?t=8506&p=48205#p48205)
