Cannot focus a disabled or invisible window

Received this error while creating WPF plugin. Traced the error into hydra library source file : UHYVCLCrossPlatformVisualPluginWrapper.pas

Modified the code with additional guard code

procedure THYVCLCrossPlatformVisualPluginWrapper.ShowParented(aParent: TWinControl);

if Ctrl <> nil then begin
if Form.CanFocus then
SetFocus(Form.Handle);

**if Form.Focused then**
  Form.ActiveControl := Ctrl;

end;
end;

Thanks, logged as bugs://78586

bugs://78586 got closed with status fixed.

This bug still remains as your modification assumes that, if
you call SetFocus(Form.Handle) that the form has focus on it!

You have to check to see if the Form is Focused First (using if Form.Focused) before setting the ActiveControl!

This is the modification I made which gets rid of the error

if Ctrl <> nil then
begin
if Form.CanFocus then
begin
SetFocus(Form.Handle);

  if Form.Focused then
      Form.ActiveControl := Ctrl;
end;

end;

what version of Hydra you are using? the latest RTM ?

I believe the source we have is for 5.0.91.1169.

fixed. next beta will contain if Form.Focused then line