Wrong control captures keystrokes under Linux

I have a problem under Linux with keyboard input being sent to the wrong control; this works with no issues under Windows and macOS. I’m running Mint 20 in a VM under macOS using VirtualBox. My Windows 7/10 tests are in more VMs.

My app has a window with a large PagePanel on it. On one of the panel’s pages, the space is split between two Container Controls, one at the top and another underneath. These are separated by a grabbar which can be used to adjust the space each occupies (I use imSplitter for this).

The upper CC is filled with a canvas, on which are a number of TextAreas. The lower CC contains an HTMLViewer and a TextArea. The HTMLViewer is supposed to gather text and display images and links. It’s driven by the Quill editor (about 12k lines of JavaScript); it allows the user to enter and format text and choose an images or create links.

The issue is this: after the app starts and initialisation has completed, I’d expect to be able to click in the HTMLViewer and start typing text. What happens is that the text might be ignored, or if I’ve clicked in a TextArea in the upper CC and then back in the HTMLViewer, the text is captured in the TextArea instead of the HTMLViewer, even though the latter has the focus (blinking cursor). I can get text accepted in the HTMLViewer, but only if I click in the TextArea underneath the HTMLViewer and back again. But if I press the return key while typing in the HTMLViewer, those might go to either the upper or following TextAreas.

Whether I build the app and transfer the executable into the Linux VM, or use remote debugging, the behaviour is the same: the wong control is capturing keystrokes. Using breakpoints in some Keydown event handlers just confirms what I can see.

If anyone has some pointers as to where I might look I’d appreciate it.

I was able to test this under Linux Mint running directly on my Mac (no VM). Same behaviour.

I also tested this on a Raspberry Pi - same behaviour.

Meanwhile I created a simple example to show the behaviour. Apart from two Open event handlers, it contains no code at all, just controls. I’ve verified that it behaves as it should under macOS, but fails in a Linus VM and a Pi. I was about to test in a Windows VM but found I had deleted them all. So that is the next step, after which I will post a Feedback including the simple test project.

Case feedback://showreport?report_id=63254 submitted.

See also case feedback://showreport?report_id=58734 which was another show-stopper for my app under Linux, until I used a workaround.