Anki 24.04.1 (ccd9ca1a) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Linux-6.8.5-zen1-1-zen-x86_64-with-glibc2.38
===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AnkiConnect ['2055492159', 2024-02-27T04:37, 'None', '']
===IDs of active AnkiWeb add-ons===
2055492159
===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
I have searched about to see if I could find anyone else mention this issue (on github, the forum, the general web) but couldn’t see it.
In linux, in addition to the familiar copy-paste clipboard, there’s a ‘selection’ made when you highlight text with the cursor and normal behavior is for this selection to be updated when releasing the mouse button - you can paste said selection with the middle mouse button.
Anki appears to update this multiple times as you drag with the mouse.
I use a script (on a system level, not within Anki specifically) which monitors the selection for changes and processes it, which is why I noticed this probably rather obscure bug.
It doesn’t appear to be normal QT application behavior (e.g. Kate, another QT 6 app, only updates the x selection when releasing the mouse button)
You’ll need to poke about in editor.py to see if you can figure out why it’s happening. On a Linux system here, _on_clipboard_change() is only called for me when an Anki receives focus, not as dragging is done.
Thanks for the suggestion, I don’t think I know enough to meaningfully poke about the source code. I’m really not a programmer, although I will sometimes hit my head against the wall until I get a script to do something I want.
I think the issue is unrelated to the editor screen (although it does also behave that way)
for example, here’s what monitoring the selection in a simple loop does when selecting text on the Statistics window:
I tried cloning the repo and grepping the whole source code for ‘select’ just to see if something jumped out at me as a thing I should check out but I have no idea!
For an idea of how other software handles the x selection clipboard