# Bizarre Linux bug

**URL:** <https://forum.juce.com/t/bizarre-linux-bug/20947>\
**Category:** Linux\
**Created:** [February 13, 2017, 6:32pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947 "2017-02-13T18:32:36Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [February 13, 2017, 6:32pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/1 "2017-02-13T18:32:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [February 14, 2017, 9:42am UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/2 "2017-02-14T09:42:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [February 14, 2017, 5:15pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/3 "2017-02-14T17:15:37Z")

</div>

Yup, I have latest develop for both plugins and host

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [February 14, 2017, 9:20pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/4 "2017-02-14T21:20:15Z")

</div>

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
{
public:
    Dot()
    {
        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

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [February 20, 2017, 5:30pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/5 "2017-02-20T17:30:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [February 20, 2017, 8:42pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/6 "2017-02-20T20:42:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [March 21, 2017, 5:06pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/7 "2017-03-21T17:06:23Z")

</div>

Any luck on tracking this down?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 3, 2017, 11:15am UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/8 "2017-04-03T11:15:01Z")

</div>

Hi @RolandMR,

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

Fabian

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [April 3, 2017, 11:26pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/9 "2017-04-03T23:26:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 4, 2017, 7:48am UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/10 "2017-04-04T07:48:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 4, 2017, 3:27pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/11 "2017-04-04T15:27:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [April 4, 2017, 4:02pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/12 "2017-04-04T16:02:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 4, 2017, 4:05pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/13 "2017-04-04T16:05:09Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 13, 2017, 2:04pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/14 "2017-04-13T14:04:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [April 13, 2017, 2:18pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/15 "2017-04-13T14:18:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 13, 2017, 2:19pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/16 "2017-04-13T14:19:20Z")

</div>

Just the host.&nbsp;&nbsp;

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [April 13, 2017, 5:30pm UTC](https://forum.juce.com/t/bizarre-linux-bug/20947/17 "2017-04-13T17:30:53Z")

</div>

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