User input events delayed (Juce >= 6.0.5 on Linux)

Hi all,

I am facing a very strange behavior and have no idea how to correct it. Basically, on Linux (Debian 10 - it does NOT happen on Windows) user input events (keyboard, mouse clicks) are 1 time out of 3 ignored, TILL I move the mouse.


  • I click down and up on a Button.
  • Nothing happens.
  • I move the mouse.
  • The button is considered clicked.

The same when using keyboard shortcuts (via Command):

  • Press a key.
  • Nothing happens.
  • I move the mouse.
  • The key pressed is detected.

This happens since JUCE >= 6.0.5, on Linux. I can’t find anything in the changelog that might indicate what change could provoke such a behavior.

I noticed that this “lag” depends on what Components are displayed. I’ve got a Vu-meter that seems to increase the problem. The worst is when I display a JUCE ListBox (the items are static, nothing fancy. Their number DO have an influence (with only 30 items shown, the lag happens almost every time)). Overall my UI is not complex at all.

Does anybody have this problem before? This is really strange and drives me crazy.

Thanks a lot!

Thanks for reporting this issue. I was able to reproduce the problem, but only in debug mode. I tracked the issue down to a call to XSynchronize which was only made in debug builds.

We’ve now made the XSynchronize call opt-in rather than opt-out, so mouse handling in debug builds should work correctly by default.

Please try out this change and let us know if it resolves the problem for you.


THANK YOU!!! It seems to be working. I can now use the latest version of JUCE. Strange that I seem to be the only one having this issue though.

Thanks again!

Yes, it’s strange that the issue doesn’t seem to affect everyone. Even once I knew what to look for the issue was intermittent. I only started seeing the problem at all after updating to 21.10, and my colleague wasn’t able to reproduce the issue on any Linux system.

Glad it’s working for you now!