Gtk error message and bug using SynEdit and SynAutocomplete lazarus / 31-LCL ---------------------------------------------------------------------- Uto · 2015-09-09 15:32 Hi All, Recently I got a report about problems to copy and paste in an application of mine, and about  a message showing in the console output when user drags over SynEdit component to select some text. Actually I've seen it happens all the time, no matter if selection is made  using mouse or keyboard, or even if Ctrl+C is pressed. Also, it seems despite the SynEdit component shows text as selected, it is not, cause is you click Ctrl+C (that should copy to clipboard) text is not copied. All that stops happening as soon as user  presses Ctrl+V; since that very moment you can again drag without getting error messages in console, you can copy/paste without problems, etc. The message in the console is this one: Code: [Select](testSyneditClipboard:4584): Gtk-CRITICAL **: IA__gtk_selection_owner_set: assertion `widget == NULL || gtk_widget_get_realized (widget)' failed I have managed to reproduce it in an isolated project, just by adding a SynEdit component  and a SynCompletion component, and linking the Editor property of SynCompletion to SynEdit. You can get the source file for that project in the attachment. Enviroment: Lazarus 1.4.2 running on Debian 7 - 32 bit. This bug cannot be reproduced in Windows (what anyway makes sense as Windows does not use Gtk). ---------------------------------------------------------------------- Uto · 2015-09-09 21:40 Update: I compiled the code in a 64bits machine (with Lubuntu) and got the same message/error. ---------------------------------------------------------------------- Martin_fr · 2015-09-09 22:51 best to report it on the bugtracker. From the error it sounds like it is an issue with the "LCL gtk" code. Btw on GTK you have to clipboards. If you select text, and then (usually) middleclick, in an other editor. Does that paste the selection (without ctrl-C)? Does the error get printed when 1) You start selecting and/or you unselect (i.e. entirely remove all selection)? 2) you press ctrl-C ? Is the presence of the completion enough? That is, even if it is NEVER triggered? Or does the error only happen after it was once triggered? ---------------------------------------------------------------------- Uto · 2015-09-11 23:41 Quote from: Martin_fr on September 10, 2015, 12:51:24 ambest to report it on the bugtracker. From the error it sounds like it is an issue with the "LCL gtk" code. Hmmm... yes, it seems to be a bug. Quote from: Martin_fr on September 10, 2015, 12:51:24 amBtw on GTK you have to clipboards. If you select text, and then (usually) middleclick, in an other editor. Does that paste the selection (without ctrl-C)? No, selection is not made in any case , despite the text is marked. Quote from: Martin_fr on September 10, 2015, 12:51:24 amDoes the error get printed when 1) You start selecting and/or you unselect (i.e. entirely remove all selection)? 2) you press ctrl-C ? When I start selecting or unselecting, no matter if I do it with mouse or keyboard. Quote from: Martin_fr on September 10, 2015, 12:51:24 amIs the presence of the completion enough? That is, even if it is NEVER triggered? Or does the error only happen after it was once triggered? Presence is enough. I just run the test project, and first thing I do is selecting text in the synedit window, and error message pops up in console. ---------------------------------------------------------------------- Martin_fr · 2015-09-12 00:13 Quote from: Uto on September 12, 2015, 01:41:55 amQuote from: Martin_fr on September 10, 2015, 12:51:24 amBtw on GTK you have to clipboards. If you select text, and then (usually) middleclick, in an other editor. Does that paste the selection (without ctrl-C)? No, selection is not made in any case , despite the text is marked. Technically a selection is made, actions like "indent selection" or "toggle comment" will work. What does not work is getting the selection into the clipboard. QuoteQuote from: Martin_fr on September 10, 2015, 12:51:24 amDoes the error get printed when 1) You start selecting and/or you unselect (i.e. entirely remove all selection)? 2) you press ctrl-C ? When I start selecting or unselecting, no matter if I do it with mouse or keyboard. When you start selecting (change from no selection to some selection) the Editor calls a method named "AquirePrimarySelection" When the last bit of a selection is unselected, the editor calls "SurrenderPrimarySelection" Obviously those fail. Someone from the developer team who has gtk experience needs to look at it (I only know SynEdit). That is why it needs to be reported as gtk bug (From all I can see, SynEdit is just a way to trigger it (probably there are other ways too)). SynCompletion creates a (hidden) window with certain properties (borderless, fsSystemStayOnTop, ...). Maybe that triggers something in the gtk code. Anyway, unfortunately I do not know the underlying lcl-gtk code that well. So I dont know what causes the error. ---------------------------------------------------------------------- Uto · 2015-09-13 15:05 Hmmm... I've tried to use the bugtracker, but I'm not sure how to catalogue this bug. First I get a selection to choose project (where there are three options that may be the ones: Lazarus, Lazarus/Packages and Lazarus/Patches) and the if I select Lazarus I get a long where none of the options is "gtk"... maybe I should choose LCL or other). Please advice :-) Maybe I shoudl just create it on LCL and developers will re-assign properly ---------------------------------------------------------------------- Martin_fr · 2015-09-13 16:33 Project: Lazarus (thats the important one) Category: WidgetSet then further down is an option for gtk. But yes don't worry, all those can be changed. ---------------------------------------------------------------------- Uto · 2015-09-14 09:52 Report made! http://bugs.freepascal.org/view.php?id=28679 I hope it helps developers to fix it :-)