Exception Raised after MouseDown in Grid (Cannot focus a disabled or invisible window)
- Lazarus/FPC Version: Lazarus 2.2.0 (lazarus_2_2_0) FPC 3.2.2 x86_64-darwin-cocoa, Lazarus 2.2.0 (rev lazarus_2_2_0) FPC 3.2.2 x86_64-win64-win32/win64
- Operating System: MacOS 12.2.1, Windows 11
- CPU / Bitness: 64Bit
What happens
after click in a Grid to toggle TabSheet, Exception will be Raised: Cannot focus a disabled or invisible window. the details are:
- there are two TabSheets in a PageControl, and a Grid in a TabSheet
- toggle TabSheet in MouseDown of the Grid, and the exception raised
- this happens on Cocoa and win32, i haven't tested on other platform
What did you expect
no exception
Steps to reproduce
an example is attched for your reference:
- click any cell in the Grid, and the exception will be raised
- but click in the Edit Control, it's fine
My guess
while clicking in a Grid, TabSheet is toggled in MouseDown. Now the Grid is hidden, and Grid is a Dragable control, may be it remains capture state, and cause the exception.