Focus Grabbing issue on Linux with TextBox

So I have been seeing a weird behavior that only happens on Linux for me. You can reproduce this by using the demo.

  1. After opening the DemoRunner, go to the WidgetsDemo.h Demo tab. Then go to Misc, where you have two text editors and a combo box.

  2. Click on the first text box, and make sure it is selected (blinking cursor)

  3. Click on some other window (not JUCE), so that the DemoRunner doesn’ t have keyboard focus.

  4. Click on the second text box.

Result: You will see the cursor flash once on the second text box, but the first text box will be the one with actual focus.

This gets very frustrating because it can also happen with other windows created by JUCE. Not sure if it is a TextBox issue, or a more general one.

Which Linux distro are you using? I’m not seeing this behaviour on Ubuntu 18.04.2 LTS.