[Solved]Lazarus 3.0: Where has copy/paste gone off to?? lazarus / 9-Editor ---------------------------------------------------------------------- cdbc · 2024-02-09 05:22 Hi Last night, I just wanted to copy some text from a snippets-file, I'd opened in KATE (my other editor on Linux), to the Lazarus editor and all I got was the last text-bit, I'd copied before from within laz- editor. Not the text-bit from KATE?!? How can that be? Are the 2 apps not using the same clipboard?!? ...or where's the setting I need to flip, to get the stuff from KDE's clipboard??? It's just a little bit annoying  I have no problems doing that in laz 2.2.6 Any help will be appreciated Regards Benny ---------------------------------------------------------------------- dbannon · 2024-02-09 07:42 Benny, it works fine here for me. Using pluma not kate ... But I have had a report (also not reproducible) from someone who says that my app, built with Lazarus 3.0 does not support copy and paste. Thats on Gnome. So, if you build something, perhaps with a TMemo in it, can you copy and paste into / from that ?  Davo ---------------------------------------------------------------------- cdbc · 2024-02-09 08:05 Hi @Davo: I've tried all possible scenarios, The problem is: I can't paste into laz-editor, from other sources. Not built by me(fpc/laz itself) or by anybody else(chrome,kate,laz-226,even the console)! I do not understand. When I paste into laz, it pastes the last text copied from within itself  nothing else... Regards Benny ---------------------------------------------------------------------- dbannon · 2024-02-09 09:30 But Benny, can you paste into a app made in Laz3 from something else ? Put a TMemo on a form, compile, launch it, perhaps from outside Lazarus. If the problem shows up there you may be able to start debugging, much easier than trying to debug lazarus itself. Some suggestions - Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...uses ClipBrd;   ...procedure TForm1.CheckClipboard();var    I : integer;  List : TStringList;begin     List := TStringList.Create;    try      ClipBoard.SupportedFormats(List);        for i := 0 to List.Count-1 do begin            if List.Strings[i] <> '' then                Memo1.Append('Format=' + List.Strings[i]);        // uncomment to see all available formats            case List.Strings[i] of              'Rich Text Format', 'text/plain', 'UTF8_STRING' :                    ReadClip(List.Strings[i]);            end;        end;    finally      List.Free;    end;end; procedure TForm1.ReadClip(TheFormat : ANSIString);var  Stream: TMemoryStream;  Fmt : TClipboardFormat;  List : TStringList;begin    if TheFormat = '' then exit;    Stream := TMemoryStream.Create;    List := TStringList.Create;    try        if Clipboard.HasFormatName(TheFormat) then begin            Memo1.Append(#10+ '------' + TheFormat + '------');            Fmt := ClipBoard.FindFormatID(TheFormat);            ClipBoard.GetFormat(Fmt, Stream);            if Stream.Size > 0 then begin                Stream.Seek(0, soFromBeginning);                List.LoadFromStream(Stream);                Memo1.Lines.AddStrings(List, False);            end;        end;    finally        List.Free;        Stream.Free;    end;end;   Just a suggestion ...... (I cannot help, my copy and paste, on every platform I tested, works fine ! ) Davo ---------------------------------------------------------------------- cdbc · 2024-02-09 10:53 Hi @Davo: I just tried your suggestions, apps made with laz 3.0 are working just fine...: paste into and copy outof => NO Problem. I Cannot paste into the laz-editor from outside sources. If I paste into laz-editor (Ctrl+V) it inserts the last bit of text copied from itself. That's IT. Maybe I should just bite the bullet and revert to laz 2.2.6, where everything works  Thank you for your attention and suggestions, they've pinpointed the problem. Regards Benny ---------------------------------------------------------------------- cdbc · 2024-02-09 13:54 Hi @Davo: Would you believe, that after I keyed in your "CheckClipboard"(couldn't paste it...) and ran it, needs LCLType, btw. It now /sometimes/ accept text to be pasted in  Not all sources, but a few select... I'm Clueless  Regards Benny ---------------------------------------------------------------------- JuhaManninen · 2024-02-09 20:21 Here I can copy text from Kate and paste to Lazarus editor. Tested with Lazarus trunk wirh GTK2 and QT5 in Manjaro Linux + KDE. ---------------------------------------------------------------------- cdbc · 2024-02-09 20:40 Hi I did all possible tests, to no avail... But, suddenly, after running Davo's example code, it started accepting in put from foreign sources?!? I then opened other projects and it continues to accept pasted input....? It can't be because of included units in source-file...?!? Can't explain that. Regards Benny ---------------------------------------------------------------------- dbannon · 2024-02-09 23:14 OK, that really is weird ! I mentioned I had a bug report about my app, a copy and paste problem on Debian Gnome Trixie using Qt5. While I told you I could not reproduce it, thats not completely true, I did see, initially, a problem. I jumped back to my machine, wrote that code to show what was happening but when I moved that app to the Gnome VM, no sign of the problem. I rebooted it, no sign of the problem. I rebuilt it, no sign of the problem. It must be a random issue. Why Benny sees more of it, IDK. Benny, while it is playing up, does that code you have there now report whats in the system clipboard ? It does sound, just a bit, as if there is two clipboards in place, one is the shared system clipboard, sometimes a private LCL clipboard. Quite worrying. Benny, if you make a stand alone app with that code, and run it outside of Lazarus, does it see the LCL clipboard or the System one ? This is very frustrating, I wish I could replicate it here !  It must be a very rare situation that triggers it, we all use copy & Paste a lot IMHO but we have only two reports of it happening ?  David ---------------------------------------------------------------------- cdbc · 2024-02-10 06:55 Hi @Davo: QuoteBenny, while it is playing up, does that code you have there now report whats in the system clipboard ? It does sound, just a bit, as if there is two clipboards in place, one is the shared system clipboard, sometimes a private LCL clipboard. Quite worrying.I've checked what's in the system clipboard at that point in time, with various apps ...and it contains the 'correct' copied text-bit. To me it feels like there are 2 clipboards at play here... I was wondering, if lazarus, with 'code-folding' and all, has its own internal clipboard?!? In the 'Options' dialog there's a checkbox for that  If so, then how does it know which one to use, at a particular point in time? I'm completely baffled... QuoteBenny, if you make a stand alone app with that code, and run it outside of Lazarus, does it see the LCL clipboard or the System one ?System. There must be somebody in this forum, who's 'in the know' 'bout SynEdit??? Regards Benny ---------------------------------------------------------------------- cdbc · 2024-02-11 21:42 Hi I'm Sorry to have to say this, but I've reverted to lazarus 2.2.6! Lazarus 3.0 is simply useless to me without copy/paste from sources outside lazarus itself! Regards Benny ---------------------------------------------------------------------- dbannon · 2024-02-12 02:57 Benny, I may be a bit late. Do you still have your Las 3.0 install in place ? I just spotted you use PCLINUXOS and KDE. A combination that has seen some problems elsewhere (Mainly Wayland orientated but ...). And KDE has a clipboard manager built in too.  You can apparently disable the clipboard manager actions, just revert to one item in clipboard at a time. That does have a history of solving problems like this. https://www.pclinuxos.com/forum/index.php/topic,153296.0.html As I understand it PCLinuxOS takes the newest KDE available and, as I mentioned, new KDEs do seem to have some issues. I'll bring up a VM and see what I can find. Davo ---------------------------------------------------------------------- dbannon · 2024-02-12 04:52 Sorry Benny, I cannot reproduce your problem on a Virtual Box VM and PCLinuxOS KDE, copy & paste all works perfectly. Does sound a bit like you have a misconfigured clipboard manager as I suggested previously. But, wow, its a distribution with an identity crisis isn't it ?  It uses apt and synaptic but with rpm packages not debs ? It does not have sudo, it has a vim that works like vi, ie no cursor keys in edit mode. It does not have FPC in its repo (thats very sad). Installing a (Source Forge) FPC rpm is problematic in that the fpc.cfg file thinks it in a deb based machine but directory structure is more like a rpm machine, so fpc.cfg needs manual intervention. Even its unzip commands generate warnings about being unable to change file attributes. No man page for apt ? Thats a serious one, given how apt turns out to expect rpm files ! Davo ---------------------------------------------------------------------- cdbc · 2024-02-12 07:47 Hi Davo Mmmm, still got the (!¤"%#&) thingy... Was first item on my todo-list, to 'nuke it'  Then came you...:QuoteYou can apparently disable the clipboard manager actions, just revert to one item in clipboard at a time. That does have a history of solving problems like this. Yes one can(never did though) and guess what... it was set to a reactiontime of 8 secs!!! with a lock-hold-time of 0! I thought, 'well that can't be right, can it?' and then set reactiontime to 1 = no effect, then tried a lock-hold-time of 10... and lo and behold, it now seems to work as it should \o/\o/\o/ Mind you 10 ms is a lifetime in qt-regi  But keep your fingers crossed, as it seems to work now Thanks for the tip and the effort. On another note:QuoteBut, wow, its a distribution with an identity crisis isn't it ?Weeellll, you could call it 'Opiniated', 'Strongwilled', 'Conservative' and outright 'Texan', while at the same time, staying at forefront of things(IF they work!) It is very much 'in lieu' with our distro "Patriarch" TexStar a.k.a. Bill Reynolds, former Banker, now fulltime distro-don.  Sudo = /Modernistic humanioura/ FPC = We do have a rock-solid 3.2.2-fixes in the repo(& on my machine) LAZ = We do have a stable 2.2.6 in the repo. The 3.0 release is not yet deemed good/stable enough the get in the repo!! (fpcupdeluxe to the rescue) Lennart Poettering =  SystemD = Lennart Poettering... Wayland= Full of holes that need to be mended. No way near our repo! KDE6 = Not yet usable/stable enough to enter our repo! BUT, when you get into it and up and running(10+10 minutes from scratch to running), IT JUST WORKS!!! Usually(knock on wood) I have no worries or headaches whatsoever  Found it in 2009 and never looked back...  Anyway, thanks Davo  Regards benny ---------------------------------------------------------------------- dbannon · 2024-02-12 08:15 Quote from: cdbc on February 12, 2024, 08:47:22 am... Sudo = /Modernistic humanioura/ I could not live without sudo. Ahh, I see, the minimal install dies not refresh the apt database. Manually refresh now, sudo is there now. So is fpc etc. That looks a lot better. I could have saved a heap of time if only I refreshed earlier ! Quote from: cdbc on February 12, 2024, 08:47:22 amWayland= Full of holes that need to be mended. No way near our repo! Indeed. So why are so many distros shipping with it enabled by default ?  My view ? it started with Fedora (which is, of course just a beta, or maybe alpha, test platform for RedHat). The others were worried they may look like they are being left behind. We suffer. Lets hope we have made some progress here ! Davo ---------------------------------------------------------------------- cdbc · 2024-02-12 08:36 Hi Davo I've happily used/use SU since my early *nix days... When I see what sort of /small'ish/ problems we're dealing with and comparing them to this "Michaelsoft BinBows" problems, I maybe understand why they're slowly killing it off...  So far nothing else broke in my fiddlings \o/ Keeping them crossed though  PS.: keep playing with it, it's quite a nifty little distro  Regards Benny