On Monday, March 31st, 2025 at 3:41 AM, Lucas de Sena <lu...@seninha.org> wrote:

> You can try to terminate/kill KDE's clipboard manager while you are doing
> your experiments with the CLIPBOARD selection.

I did and now the code works.
To disable (at least, partially) the clipboard manager in my system: 
go to System Tray Settings (right click in the arrow near the bottom
right corner of the Desktop, then click on `Configure System Tray'),
Entries, System Services, Clipboard. Select `Disabled' and click on
`Apply'. The copy-paste mechanism is still available, but probably the
history and other advanced features are not. After this, the program
still lists a long series of

Requestor: 0x1e0005b
Denying request of type 'TARGETS'

but then it waits and doesn't end. If I try to paste the string provided 
by the program (which is the current time and date):

Requestor: 0x2c00f16
Denying request of type 'text/plain;charset=utf-8'
Requestor: 0x2c00f16
Sending data to window 0x2c00f16, property 'GDK_SELECTION'

The string is pasted as expected. Referring to the code, I don't 
understand why the request of type 'text/plain;charset=utf-8' doesn't
match

utf8 = XInternAtom(dpy, "UTF8_STRING", False);

but anyway the request is processed, then. Maybe 
'text/plain;charset=utf-8' corresponds to a slightly different atom?

> Or you can edit the code
> to use the PRIMARY selection instead, which clipboard managers (usually)
> do not mess with.

I also tried this, but it makes the program end even sooner (with the 
clipboard manager enabled):

Requestor: 0x1e0005b
Denying request of type 'TARGETS'
Requestor: 0x1e0005b
Denying request of type 'TARGETS'
Lost selection ownership

(again, 0x1e0005b belongs to `Qt Clipboard Requestor Window — Plasma').

Thank you so much!

Travis

Reply via email to