HandleKey in Windows invoked for hover not focus

I’m finding that the HandleKey() function is getting called for the component which is hovered over by the mouse rather than the component that has focus.

This only seems to happen for me in Windows, not Mac or Linux. We’ve seen this in 5.30.02 and 5.30.06. We’re pretty sure we started seeing the problem when we upgraded from v5.26.00.

For example, with TGTextEntry components, whenever we hover over one and type, the text appears in the text entry. Move the mouse cursor over a different TGTextEntry and the text will appear there (without clicking on it). The cursor doesn’t move, so it doesn’t seem like the focus has actually changed.

It is rather annoying for Windows users, as it means they have to keep the mouse cursor hovered over the component they want to enter text in. They cannot click in the component and move the mouse cursor out of the way.

It seems to be a Windows-only issue? I’m wondering if this is a known problem that may have a workaround or fix?

I believe I’ve been able to confirm that this is a “feature” (bug?) in ROOT starting at least in v5.26.00 for Windows.

If I run the tutorials/gui/textEntries.C script with v5.26.00, I can reproduce the error. It is not as pervasive with v5.26.00, though. If I switch applications away from the textEntries script and then switch back, then hover over a TGTextEntry (no click/focus) and type at the same time, the text appears in whichever field is hovered. If you give a field focus, the keys pressed will appear in the focused field. Once focus is given, it seems the hover “feature” goes away.

This is different from what I am seeing with v5.30, where hover always lets you type in a field and focus doesn’t seem to matter at all.

Just found this: savannah.cern.ch/bugs/?func=det … m_id=88796

I’ll be testing the new version…