Author Topic: Bug in GTK3 Clipboard ?  (Read 344 times)


  • New Member
  • *
  • Posts: 11
Bug in GTK3 Clipboard ?
« on: November 01, 2022, 01:58:05 am »
Code: Pascal  [Select][+][-]
  1.   Clipboard.AsText := 'Hello world';
  2.   writeln(Clipboard.AsText)
will print 'Hello world' as expected, the content of the clipboard cannot be pasted into a memo on the same form or into a text editor.  Similarly, text assigned to PrimarySelection cannot be pasted into a terminal with Shift+Enter. Strangely memo.PasteFromClipboard will work even when the context menu of the memo shows that there is nothing to paste.

The attached program shows that if the text is copied to the clipboard or primary selection with the Gtk3 procedure gtk_clipboard_set_text, then it can be pasted as usual.

Hopefully, the second version of the program (2022-11-05) makes the problem more obvious.

This behaviour is not observed with Gtk2 and Qt5. Have I made some sort of error in installing Gtk3 or is this a genuine bug? If it is the latter, is it known? I could not find anything about it.

I tested version 2 of the program compiled with
  Lazarus 2.3.0 (rev main-2_3-2190-g4628b33d4a)
  FPC 3.3.1 x86_64-linux-qt5
on Linux Mint 21 MATE (5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64)
with the following gtk3 libraries

Version 2 of the program was also tested with an older compiler
  Lazarus 2.3.0 (rev main-2_3-1602-gdb285860e3)
  FPC 3.3.1 x86_64-linux-gtk2
on Linux Mint 21 Cinnamon (5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64)
with the same gtk3 libraries

and on Linux Mint 20.1 MATE (5.4.0-128-generic #144-Ubuntu SMP Tue Sep 20 11:00:04 UTC 2022 x86_64)
with the older gtk3 libraries

« Last Edit: November 05, 2022, 07:58:50 pm by desliem »


TinyPortal © 2005-2018