diff --git a/lcl/interfaces/customdrawn/customdrawnobject.inc b/lcl/interfaces/customdrawn/customdrawnobject.inc index a6acf2ab5b..5cc0971d1f 100644 --- a/lcl/interfaces/customdrawn/customdrawnobject.inc +++ b/lcl/interfaces/customdrawn/customdrawnobject.inc @@ -59,6 +59,7 @@ begin // Also mark in the window information the focus change TCDForm(lForm.Handle).FocusedControl := ALCLControl; + TCDForm(lForm.Handle).FocusedIntfControl := FocusedIntfControl; // Verify if the virtual keyboard needs to be shown/hidden // Only show if there is no hardware keyboard, but hide always in case diff --git a/lcl/interfaces/customdrawn/customdrawnwinapi.inc b/lcl/interfaces/customdrawn/customdrawnwinapi.inc index d4bcd68933..df4bc48f97 100644 --- a/lcl/interfaces/customdrawn/customdrawnwinapi.inc +++ b/lcl/interfaces/customdrawn/customdrawnwinapi.inc @@ -2852,8 +2852,10 @@ end;*) function TCDWidgetSet.GetFocus: HWND; begin Result := 0; - if FocusedIntfControl <> nil then Result := FocusedIntfControl.Handle - else if FocusedControl <> nil then Result := FocusedControl.Handle; + // Don't return the intfcontrol, we try to pretend it doesn't exist + {if FocusedIntfControl <> nil then Result := FocusedIntfControl.Handle + else} + if FocusedControl <> nil then Result := FocusedControl.Handle; end; (*function TQtWidgetSet.GetKeyState(nVirtKey: Integer): Smallint;