diff --git a/components/synedit/synpluginsyncroedit.pp b/components/synedit/synpluginsyncroedit.pp index 60d16b2c14..88b1c527f5 100644 --- a/components/synedit/synpluginsyncroedit.pp +++ b/components/synedit/synpluginsyncroedit.pp @@ -722,13 +722,17 @@ var begin if not Enabled then exit; if FGlyphLastLine <> -2 then begin - rcInval := GetGutterGlyphRect(FGlyphLastLine); + if SynEdit.HandleAllocated then begin + rcInval := GetGutterGlyphRect(FGlyphLastLine); + InvalidateRect(SynEdit.Handle, @rcInval, False); + end; + end; + if SynEdit.HandleAllocated then begin + rcInval := GetGutterGlyphRect; + // and make sure we trigger the Markup // TODO: triigger markup on gutter paint too + rcInval.Right := Max(rcInval.Right, TSynEdit(SynEdit).GutterWidth + 2); InvalidateRect(SynEdit.Handle, @rcInval, False); end; - rcInval := GetGutterGlyphRect; - // and make sure we trigger the Markup // TODO: triigger markup on gutter paint too - rcInval.Right := Max(rcInval.Right, TSynEdit(SynEdit).GutterWidth + 2); - InvalidateRect(SynEdit.Handle, @rcInval, False); end; procedure TSynPluginSyncroEditMarkup.DoCaretChanged(Sender: TObject); @@ -744,8 +748,10 @@ begin inherited DoTopLineChanged(OldTopLine); // Glyph may have drawn up to one Line above if FGlyphLastLine > 1 then begin - rcInval := GetGutterGlyphRect(FGlyphLastLine - 1); - InvalidateRect(SynEdit.Handle, @rcInval, False); + if SynEdit.HandleAllocated then begin + rcInval := GetGutterGlyphRect(FGlyphLastLine - 1); + InvalidateRect(SynEdit.Handle, @rcInval, False); + end; end; DoInvalidate; end; @@ -763,8 +769,10 @@ begin inherited DoEnabledChanged(Sender); if not Enabled then begin if FGlyphLastLine <> -2 then begin - rcInval := GetGutterGlyphRect(FGlyphLastLine); - InvalidateRect(SynEdit.Handle, @rcInval, False); + if SynEdit.HandleAllocated then begin + rcInval := GetGutterGlyphRect(FGlyphLastLine); + InvalidateRect(SynEdit.Handle, @rcInval, False); + end; end; FGlyphLastLine := -2; end diff --git a/ide/include/ide.inc b/ide/include/ide.inc index a7c6cea676..ea97de360d 100644 --- a/ide/include/ide.inc +++ b/ide/include/ide.inc @@ -19,9 +19,11 @@ *************************************************************************** } +// !!! if you change any of these flags, you have to make cleanide !!! +{$inline on} + { $DEFINE IDE_VERBOSE} -// !!! if you change any of these flags, you have to make cleanide !!! { $DEFINE IDE_MEM_CHECK} { $DEFINE IDE_DEBUG} @@ -44,8 +46,17 @@ { $DEFINE VerboseJITForms} { $DEFINE VerboseFormEditor} - -{$inline on} +// TODO: Test on all platforms +{$IFNDEF DisableAsyncProcess} + {$IFDEF Linux} + {$IFDEF CPUI386} + {off $DEFINE UseAsyncProcess} + {$ENDIF} + {$ENDIF} + {$IFDEF windows} + {$DEFINE UseAsyncProcess} + {$ENDIF} +{$ENDIF} // end. diff --git a/ide/main.pp b/ide/main.pp index 4c3e0a80d2..ee8237aaae 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -52,18 +52,6 @@ unit Main; interface -// TODO: Test on all platforms -{$IFNDEF DisableAsyncProcess} - {$IFDEF Linux} - {$IFDEF CPUI386} - {off $DEFINE UseAsyncProcess} - {$ENDIF} - {$ENDIF} - {$IFDEF windows} - {$DEFINE UseAsyncProcess} - {$ENDIF} -{$ENDIF} - {$I ide.inc} uses diff --git a/lcl/asyncprocess.pp b/lcl/asyncprocess.pp index 783fcacd15..f0597a39c4 100644 --- a/lcl/asyncprocess.pp +++ b/lcl/asyncprocess.pp @@ -107,6 +107,7 @@ procedure TAsyncProcess.Execute; begin inherited Execute; + writeln('TAsyncProcess.Execute ',poUsePipes in Options); if poUsePipes in Options then FPipeHandler := AddPipeEventHandler(Output.Handle, @HandlePipeInput, 0); FProcessHandler := AddProcessEventHandler(ProcessHandle, @HandleProcessTermination, 0); diff --git a/lcl/interfaces/gtk/gtkwidgetset.inc b/lcl/interfaces/gtk/gtkwidgetset.inc index 122a5e2f4f..1f540fefc0 100644 --- a/lcl/interfaces/gtk/gtkwidgetset.inc +++ b/lcl/interfaces/gtk/gtkwidgetset.inc @@ -573,6 +573,10 @@ end; {$ifdef Unix} procedure TGtkWidgetSet.PrepareSynchronize(AObject: TObject); +{ This method is the WakeMainThread of the unit classes. + It is called in TThread.Synchronize to wake up the main thread = LCL GUI thread. + see: TGtkWidgetSet.InitSynchronizeSupport +} var thrash: char; begin @@ -638,6 +642,10 @@ begin end; procedure TGtkWidgetSet.InitSynchronizeSupport; +{ When a thread calls its Synchronize, it calls + WakeMainThread (defined in the unit classes). + Set +} begin { TThread.Synchronize ``glue'' } WakeMainThread := @PrepareSynchronize;