getMouseXYRelative ignoring window offset

I’m having a weird issue, where getMouseXYRelative() acts like the plugin-window was in the top left corner off the screen regardless where it actually is. Meaning: if I position the window top-left, everything works fine, moving it away, I have to trigger the sections as if it was top-left.

I only have this issue in the VST2-build, the standalone acts normal (both Linux).

I tried to dig a litte deeper: The function getMouseXYRelative() seems to be calling

Point<int> Component::getMouseXYRelative() const
{
    return getLocalPoint (nullptr, Desktop::getMousePosition());
}

which in turn tries to find the highest level component and then calculate the offset.
However I have no clue what could be wrong. Anyone with an idea?

EDIT: It seems to me that all are working well, only the highest level conversion (window -> screen) is failing. Hence the absence of the offset.

Update: I remembered I updated JUCE recently, so I tried to roll back and the issue was resolved.

The working version: JUCE 5.4.3
Non-working: JUCE 5.4.4

I’ll stay on the old version then (I updated primarily to get rid of the popup :innocent:)
Maybe the problem was on my side, but if other users experience the same there could be a problem in the new version.

There were a few changes in the Linux windowing code between 5.4.3 and 5.4.4. Can you see if the following commit fixes the issue for you?

1 Like

@ed95 Yes, I can confirm it fixes the issue! :slight_smile: