Quote from: Sieben on November 05, 2024, 04:31:53 pmOn the other hand I would considers this a serious matter on both Gtk2 and Qt5, since that ButtonClick should not be possible at all. Looks like Windows is the only reliable platform here - and I always thought focus issues were a mess there.Yes. qt5/Linux almost worked but the fact that the Button1Click 'bleeds' through when focus is prevented is indeed a serious issue.I haven't had the chance yet to test qt5 on Windows.
On the other hand I would considers this a serious matter on both Gtk2 and Qt5, since that ButtonClick should not be possible at all. Looks like Windows is the only reliable platform here - and I always thought focus issues were a mess there.
Just a few remarks on possible workarounds (and to keep this topic floating): you can reliably prevent the Button1Click handler to be executed by placing this right at the top of it's code:Code: Pascal [Select][+][-] {$ifdef LCLGtk2} if not Button1.Focused then Exit; {$endif} and you can make the SelectAll of Edit2 (all this refers to the test project included above) work by inserting this between SetFocus and SelectAll:Code: Pascal [Select][+][-] Edit2.SetFocus; {$ifdef LCLGtk2} Application.ProcessMessages; {$endif} Edit2.SelectAll; I did not test with Qt5 so far.