Bizarre Linux bug

I’ve been hunting for a Linux bug for a few days now. This is what I know for sure.

In my plugin, the position reported by MouseEvents is occasionally wrong. The mouse cursor doesn’t jump around on the screen, but anything I’m trying to drag jumps around as if the cursor is jumping or if I have a control that highlights on mouse over it flickers. I’ve traced it all the way back to the Linux windowing code and the x/y values in XPointerMovedEvent are incorrect.

If I look at the position returned by MouseInputSource::getScreenPosition() it does not jump.

During debugging I found this only happened during playback. It turns out its caused by the cursor moving in my juce based host. I have a cursor component that I call setBounds() on rather frequently to move the cursor. If I don’t move the cursor, I can drag fine in my plugin.

What I don’t understand is how this is even possible. The host and plugin are separate binaries each with their own version of juce. Not sure how they could interfere with each other at all, especially when just moving a child component in one.

Any ideas tip for tracking this down would be much appreciated.

When did you last try this? If you look at the commit history on develop you’ll see that @ftonello completely re-worked the linux backend. Can you try reproducing this on the latest develop.

Yup, I have latest develop for both plugins and host

It is easy to reproduce the issue. Build the audio plugin demo and audio plugin host. Add the following class to plugin host

class Dot : public Component, public Timer
        startTimerHz (40);

    void paint (Graphics& g) override
        g.setColour (Colours::red);
        g.fillEllipse (getLocalBounds().toFloat());

    void timerCallback() override
        if (auto* p = getParentComponent())
            Random& r = Random::getSystemRandom();
            setBounds (r.nextInt (p->getWidth()), r.nextInt (p->getHeight()), 30, 30);

and then graphPanel->addAndMakeVisible (new Dot()); in GraphDocumentComponent::GraphDocumentComponent

Here is a video of it happening:

This is on Ubuntu 14.04

Has anybody else been able to reproduce this or is it just my system?

Sorry for the delay on this. We can re-produce this bug. It’s really bizarre as it seems to stop once you minimise the host window and the spurious cursor position seems to depend on the host’s window location?!?

We’re trying to fix this and will get back to you.

1 Like

Any luck on tracking this down?

Hi @G-Mon,

Sorry for the delay. This is now fixed on develop.


1 Like

I just tried this out, doesn’t appear to be fixed on develop (testing with Ubuntu 14.04)

Did you rebuild both the host and the plug-in? It would be very odd if I fixed a bug that has the exact same symptoms as your bug.

…arrghh. I needed to revert the commit as it broke combobox input. I’m working on a different fix.

No, I didn’t rebuild the plugin as it not just my plugins showing this issue. Will all juce based plugins need to be rebuilt?

Well rebuilding plug-ins would also resolve the issue, but we are looking for another (better) solution which would only need fixing the host. I also note that I needed to revert the fix so the bug is back on develop now. Sorry…

OK. I think this is now actually, really, maybe, hopefully fixed on develop…

1 Like

About to test. Does this require rebuilding plugins or just host?

Just the host.  

Yay!!! It’s fixed!!!11!!!11!one!!11!!!