Recent

Author Topic: Unable to paste into Lazarus editor from another application  (Read 1913 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5699
    • wiki
Re: Unable to paste into Lazarus editor from another application
« Reply #15 on: May 04, 2019, 04:37:28 pm »
I can confirm the issue happens with trunk too.

It seems to be something in the lcl interface code. At least my guess after some debugging.

https://bugs.freepascal.org/view.php?id=35482
« Last Edit: May 04, 2019, 04:46:59 pm by Martin_fr »

fedkad

  • Full Member
  • ***
  • Posts: 118
Re: Unable to paste into Lazarus editor from another application
« Reply #16 on: May 04, 2019, 07:19:35 pm »
I downloaded and compiled the latest trunk of Lazarus (61136).
(No docked IDE here as far as know. I use Lazarus as it is.)
I can confirm that this problem is present in the latest trunk too.

Please, test with Gedit as follows:
  • Open Gedit. Enter some text. Select some text in Gedit. Copy to Clipboard.
  • Switch to Lazarus editor or a Lazarus program that uses ClipBoard.AsText to import some text from Clipboard.
  • The first try will return True for Clipboard.HasFormat(CF_TEXT), but a 0 length string for ClipBoard.AsText.
  • The second try will return False for Clipboard.HasFormat(CF_TEXT).

« Last Edit: May 04, 2019, 07:44:08 pm by fedkad »

Bart

  • Hero Member
  • *****
  • Posts: 3539
    • Bart en Mariska's Webstek
Re: Unable to paste into Lazarus editor from another application
« Reply #17 on: May 04, 2019, 07:22:51 pm »
Works fine for me with trunk of today on Mint 18.2-64.

Bart

fedkad

  • Full Member
  • ***
  • Posts: 118
Re: Unable to paste into Lazarus editor from another application
« Reply #18 on: May 04, 2019, 07:26:57 pm »
Do you have gnome-text-editor (gedit - Version 3.32.0) installed in your system?
Please, test with it as detailed in my previous post.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5699
    • wiki
Re: Unable to paste into Lazarus editor from another application
« Reply #19 on: May 04, 2019, 07:40:37 pm »
Copy from gedit to lazarus also does not work.

I tested what happens when I copy from Lazarus to Lazarus vs gedit to lazarus.

xclip reports the same in both cases. It gets Utf8 from the clipboard (see related issue)

In both cases (as in the issue)
  IsFormatSupported =>   RequestSelectionData =>     gtk_selection_convert in
returns false.

So it falls back to the only format, that it does not test with IsFormatSupported: COMPOUND_TEXT

The difference is probably that lazarus does deliver this (on request?).
gedit obviously does not.

simonm

  • Newbie
  • Posts: 2
Re: Unable to paste into Lazarus editor from another application
« Reply #20 on: November 04, 2019, 09:48:47 am »
Without meaning to revive an old thread, I did run into the same problem after going to Fedora 31 where I couldn't paste from any other application into the Lazarus editor.

I recalled that Fedora runs Wayland by default and then logged out and switched to Xorg. Problem solved for me!

I can now paste from other applications into the editor. Hope this helps someone.

Thaddy

  • Hero Member
  • *****
  • Posts: 9183
Re: Unable to paste into Lazarus editor from another application
« Reply #21 on: November 04, 2019, 01:07:37 pm »
Pasting from geany (on Raspbian Buster) works! which  uses wayland....

This has some interesting info https://stackoverflow.com/questions/39616066/wayland-clipboard-api  and https://wiki.gnome.org/Initiatives/Wayland/PrimarySelection
« Last Edit: November 04, 2019, 01:12:52 pm by Thaddy »
also related to equus asinus.

fedkad

  • Full Member
  • ***
  • Posts: 118
Re: Unable to paste into Lazarus editor from another application
« Reply #22 on: November 04, 2019, 08:10:06 pm »
Without meaning to revive an old thread, I did run into the same problem after going to Fedora 31 where I couldn't paste from any other application into the Lazarus editor.
I recalled that Fedora runs Wayland by default and then logged out and switched to Xorg. Problem solved for me!
I can now paste from other applications into the editor. Hope this helps someone.

It seems that the same thing happened here. Lately, I upgraded to Ubuntu 19.10 and it uses GNOME on Xorg by default. The problem does not occur here.