| @@ -147,12 +147,12 @@ public: | |||||
| Point<float> localToGlobal (Point<float> relativePosition) override | Point<float> localToGlobal (Point<float> relativePosition) override | ||||
| { | { | ||||
| return relativePosition + getScreenPosition (false).toFloat(); | |||||
| return localToGlobal (*this, relativePosition); | |||||
| } | } | ||||
| Point<float> globalToLocal (Point<float> screenPosition) override | Point<float> globalToLocal (Point<float> screenPosition) override | ||||
| { | { | ||||
| return screenPosition - getScreenPosition (false).toFloat(); | |||||
| return globalToLocal (*this, screenPosition); | |||||
| } | } | ||||
| using ComponentPeer::localToGlobal; | using ComponentPeer::localToGlobal; | ||||
| @@ -231,8 +231,11 @@ public: | |||||
| if (! c->isVisible()) | if (! c->isVisible()) | ||||
| continue; | continue; | ||||
| if (auto* peer = c->getPeer()) | |||||
| if (peer->contains (localPos + bounds.getPosition() - peer->getBounds().getPosition(), true)) | |||||
| auto* otherPeer = c->getPeer(); | |||||
| jassert (otherPeer == nullptr || dynamic_cast<LinuxComponentPeer*> (c->getPeer()) != nullptr); | |||||
| if (auto* peer = static_cast<LinuxComponentPeer*> (otherPeer)) | |||||
| if (peer->contains (globalToLocal (*peer, localToGlobal (*this, localPos.toFloat())).roundToInt(), true)) | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -474,6 +477,19 @@ private: | |||||
| JUCE_DECLARE_NON_COPYABLE (LinuxRepaintManager) | JUCE_DECLARE_NON_COPYABLE (LinuxRepaintManager) | ||||
| }; | }; | ||||
| //============================================================================== | |||||
| template <typename This> | |||||
| static Point<float> localToGlobal (This& t, Point<float> relativePosition) | |||||
| { | |||||
| return relativePosition + t.getScreenPosition (false).toFloat(); | |||||
| } | |||||
| template <typename This> | |||||
| static Point<float> globalToLocal (This& t, Point<float> screenPosition) | |||||
| { | |||||
| return screenPosition - t.getScreenPosition (false).toFloat(); | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| void settingChanged (const XWindowSystemUtilities::XSetting& settingThatHasChanged) override | void settingChanged (const XWindowSystemUtilities::XSetting& settingThatHasChanged) override | ||||
| { | { | ||||