mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 11:00:24 +02:00
LCL Carbon: set and kill focus of focused control, on form activation/deactivation
git-svn-id: trunk@16764 -
This commit is contained in:
parent
5c92367f38
commit
18c474eba2
@ -871,6 +871,8 @@ function CarbonWindow_ActivateProc(ANextHandler: EventHandlerCallRef;
|
||||
var
|
||||
Msg: TLMessage;
|
||||
EventKind: UInt32;
|
||||
Control: ControlRef;
|
||||
FocusWidget: TCarbonControl;
|
||||
begin
|
||||
{$IFDEF VerboseWindowEvent}
|
||||
DebugLn('CarbonWindow_ActivateProc ', DbgSName(AWidget.LCLObject));
|
||||
@ -894,6 +896,20 @@ begin
|
||||
end;
|
||||
|
||||
DeliverMessage(AWidget.LCLObject, Msg);
|
||||
|
||||
// force set and kill focus of focused control
|
||||
Control := nil;
|
||||
OSError(GetKeyboardFocus(AWidget.Widget, Control), 'CarbonWindow_ActivateProc', SGetKeyboardFocus);
|
||||
if Control <> nil then
|
||||
begin
|
||||
FocusWidget := GetCarbonControl(Control);
|
||||
|
||||
if FocusWidget <> nil then
|
||||
case Msg.msg of
|
||||
LM_ACTIVATE: FocusWidget.FocusSet;
|
||||
LM_DEACTIVATE: FocusWidget.FocusKilled;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user