void handleWheel (ComponentPeer& peer, Point<int> positionWithinPeer,
                      Time time, const MouseWheelDetails& wheel)
    {
        Desktop::getInstance().incrementMouseWheelCounter();

        Point<int> screenPos;
        if (Component* current = getTargetForGesture (peer, positionWithinPeer, time, screenPos))
            sendMouseWheel (*current, screenPos, time, wheel);
    }
    void handleWheel (ComponentPeer& peer, Point<float> positionWithinPeer,
                      Time time, const MouseWheelDetails& wheel)
    {
        Desktop::getInstance().incrementMouseWheelCounter();
        Point<float> screenPos;

        // This will make sure that when the wheel spins in its inertial phase, any events
        // continue to be sent to the last component that the mouse was over when it was being
        // actively controlled by the user. This avoids confusion when scrolling through nested
        // scrollable components.
        if (lastNonInertialWheelTarget == nullptr || ! wheel.isInertial)
            lastNonInertialWheelTarget = getTargetForGesture (peer, positionWithinPeer, time, screenPos);

        if (Component* target = lastNonInertialWheelTarget)
            sendMouseWheel (*target, screenPos, time, wheel);
    }
    void handleWheel (ComponentPeer* const peer, const Point<int>& positionWithinPeer, const Time& time, float x, float y)
    {
        jassert (peer != nullptr);
        lastTime = time;
        ++mouseEventCounter;
        const Point<int> screenPos (peer->localToGlobal (positionWithinPeer));

        setPeer (peer, screenPos, time);
        setScreenPos (screenPos, time, false);
        triggerFakeMove();

        if (! isDragging())
        {
            Component* current = getComponentUnderMouse();
            if (current != nullptr)
                sendMouseWheel (current, screenPos, time, x, y);
        }
    }
    void handleWheel (ComponentPeer* const peer, const Point<int>& positionWithinPeer,
                      const Time& time, const MouseWheelDetails& wheel)
    {
        jassert (peer != nullptr);
        lastTime = time;
        ++mouseEventCounter;
        Desktop::getInstance().incrementMouseWheelCounter();

        const Point<int> screenPos (peer->localToGlobal (positionWithinPeer));
        setPeer (peer, screenPos, time);
        setScreenPos (screenPos, time, false);
        triggerFakeMove();

        if (! isDragging())
        {
            Component* current = getComponentUnderMouse();
            if (current != nullptr)
                sendMouseWheel (current, screenPos, time, wheel);
        }
    }