Ok, that is the trouble with tracing stuff on Linux. There can be subtle differences between distros.
None of mine currently get the issue. I tried the 2 systems I currently have on Gtk3 (opensuse / manjaro), but both a bit older.
---------------
The only significance bit I can see in your example is that FormCreate (as well as lfm loading) is before the main form is created (before a handle for it is created). And that would be the handle for the main form of the app.
That would mean that creating the completion would have to be creating a handle before that (or accessing the clipboard before that), and that would for reasons I wouldn't know have to upset the clipboard.
So after some stepping, I found the creation of such a handle (the stackframe at the bottom is for myself)
Question, if you:
- comment out the problem call to setup the completion
- Add a 2nd form to your testapp
- in project options set the 2nd form to be NOT auto created.
- in the TForm1.FormCreated add
var f2: TForm2; // must be in uses
begin
f2 := TForm2.create(nil);
f2.canvas.handle;
Does that also cause the issue?
This may need 2 fixes.
One in the WS (gtk3) code.
And one in SynEdit. Which even if that did not cause the issue you have, shouldn't be doing what it does.
For the SynEdit part I have probably enough info. But that does only fix the trigger, not the problem.
#0 TControlCanvas.CreateHandle(TControlCanvas($00007F79B1F3A300)) at controlcanvas.inc:92
#1 TCanvas.RequiredState(TCanvas($00007F79B1F3A300), [csHandleValid, csFontValid, csPenvalid, csBrushValid]) at canvas.inc:1701
#2 TCanvas.GetHandle(TCanvas($00007F79B1F3A300)) at canvas.inc:1600
#3 TSynBaseCompletionForm.FontChanged(TSynBaseCompletionForm($00007F79B2054D30), TObject($00007F79B02C1AC0)) at syncompletion.pas:1214
#4 TSynBaseCompletionForm.Create(TSynBaseCompletionForm($00007F79B2054D30), ^$__vtbl_ptr_type($0000000000000001), nil) at syncompletion.pas:691
#5 TSynBaseCompletion.Create(TSynBaseCompletion($00007F79B1FC6040), ^$__vtbl_ptr_type(nil), TComponent($00007F79B2052970)) at syncompletion.pas:1405
#6 TSynCompletion.Create(TSynCompletion($00007F79B1FC6040), ^$__vtbl_ptr_type($0000000000000001), TComponent($00007F79B2052970)) at syncompletion.pas:1915
#7 TForm1.SetUpWidgets(TForm1($00007F79B2052970)) at unit1.pas:71
#8 TForm1.FormCreate(TForm1($00007F79B2052970), TObject($00007F79B2052970)) at unit1.pas:58
#9 TCustomForm.DoCreate(TCustomForm($00007F79B2052970)) at customform.inc:931