GTK 2: clipboard does not see content from other apps
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
Clipboard.AsText is not working on some systems, if the selection was copied by a none lazarus app.
https://forum.lazarus.freepascal.org/index.php/topic,45242
I collected the following info, on my fedora 28
Copied text from terminal
using xclip, I get the following info on the clipboard
xclip -o -selection clipboard -verbose
Connected to X server.
Using selection: XA_CLIPBOARD
Using UTF8_STRING.
Type is UTF8_STRING.
&LtPos;content....>
lcl/interfaces/gtk2/gtk2winapi.inc
called from line 364
CheckAtomFormat('UTF8_STRING',GdkFalse);
in line 288
function IsFormatSupported(CurFormat: TGdkAtom): boolean;
makes a call
SelData:=RequestSelectionData(ClipboardWidget,ClipboardType,AllID);
And SelData will be.
SELECTION: 0
TARGET: 0
_TYPE: 0
FORMAT: 0
DATA: nil
LENGTH: 0
DISPLAY: nil
This means it reports the format as not supported....
In function
function RequestSelectionData(ClipboardWidget: PGtkWidget;
line 7548
if gtk_selection_convert(ClipboardWidget,TypeAtom,FormatID,TimeID) <> GdkFalse then
the if is false. i.e., the if body is NOT executed.
ClipBoarWidget <> nil
TypeAtom = 69
FormatID = 120
timeId > 0
Mantis conversion info:
- Mantis ID: 35482
- OS: Fedora
- OS Build: 64 bit
- Platform: Linux
- Version: 2.1 (SVN)
- Monitored by: » fedkad (Fedon Kadifeli)