Commit 7efeb2a3 authored by Željan Rikalo's avatar Željan Rikalo 🏊🏼
Browse files

gtk2: fixed av with modal forms. issues #26752,#27577

git-svn-id: trunk@48136 -
parent 002d3acb
......@@ -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
if (csDestroying in TComponent(Data).ComponentState) or
(csDestroyingHandle in TControl(Data).ControlState) then
// DebugLn('NOTICE: Control is destroying itself, do not add new idle timer for ',dbgsName(TControl(Data)));
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
// DebugLn('NOTICE: Parent form is destroying, do not add new idle timer for ',dbgsName(TControl(Data)));
g_idle_add(@GtkEntryDelayClearCursorPos, Widget);
//save now CursorPos and SelStart in WidgetInfo
if (Widget <> nil) then
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment