mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 12:59:12 +02:00
gtk2: fixed av with modal forms. issues #26752,#27577
git-svn-id: trunk@48136 -
This commit is contained in:
parent
002d3acb17
commit
7efeb2a3cc
@ -1103,6 +1103,7 @@ var
|
||||
Mess : TLMessage;
|
||||
Info: PWidgetInfo;
|
||||
AStart,AEnd: gint;
|
||||
AForm: TCustomForm;
|
||||
{$IFDEF VerboseFocus}
|
||||
LCLObject: TObject;
|
||||
CurFocusWidget: PGtkWidget;
|
||||
@ -1138,8 +1139,23 @@ begin
|
||||
|
||||
// do not show selection when widget is unfocused
|
||||
// issues #18164,#21897,#23182
|
||||
if GtkWidgetIsA(Widget, gtk_type_entry) then
|
||||
if GtkWidgetIsA(Widget, gtk_type_entry) and Assigned(Data) then
|
||||
begin
|
||||
if (csDestroying in TComponent(Data).ComponentState) or
|
||||
(csDestroyingHandle in TControl(Data).ControlState) then
|
||||
begin
|
||||
// DebugLn('NOTICE: Control is destroying itself, do not add new idle timer for ',dbgsName(TControl(Data)));
|
||||
exit;
|
||||
end;
|
||||
AForm := GetParentForm(TControl(Data));
|
||||
if Assigned(AForm) and ((csDestroying in AForm.ComponentState) or
|
||||
(csDestroyingHandle in AForm.ControlState) or
|
||||
((fsModal in AForm.FormState) and (AForm.ModalResult <> mrNone)) ) then
|
||||
begin
|
||||
// DebugLn('NOTICE: Parent form is destroying, do not add new idle timer for ',dbgsName(TControl(Data)));
|
||||
exit;
|
||||
end;
|
||||
|
||||
g_idle_add(@GtkEntryDelayClearCursorPos, Widget);
|
||||
//save now CursorPos and SelStart in WidgetInfo
|
||||
if (Widget <> nil) then
|
||||
|
Loading…
Reference in New Issue
Block a user