thorium-reader icon indicating copy to clipboard operation
thorium-reader copied to clipboard

linux: text selection and middle click paste

Open atomotic opened this issue 2 years ago • 3 comments

using the Linux version, even if Ctrl+C is disallowed, is still possible to highlight a selection (or entire chapter with Ctrl+a) and then paste the text elsewhere with middle click.

probably a solution is to disable highlight/selection across the epub reader (css user-select?), but this is going to break future on annotations?

atomotic avatar Sep 23 '21 07:09 atomotic

thanks to report this

https://askubuntu.com/questions/167570/how-does-middle-click-paste-work

https://specifications.freedesktop.org/clipboards-spec/clipboards-latest.txt

panaC avatar Sep 23 '21 09:09 panaC

note that thorium doesn't disable ctrl-c, but intercepts the clipboard copy event directly. that being said, x11 bypasses the standard clipboard API completely, so indeed we have to figure out an alternative interception mechanism.

"Highlighting text without clicking is enough to get it copied to the X11 buffer-space, and middle-clicking will paste out of that."

danielweck avatar Sep 23 '21 10:09 danielweck

thus far we decided against CSS user-select:none, as this prevents legitimate text selection for bookmarking, annotations, and probably some accessibility support too. we used a different technique on MacOS to prevent ctrl-a drag+drop, so on Linux we have to find a solution for implicit x11 buffer middle-click paste that doesn't compromise other essential features.

danielweck avatar Sep 23 '21 10:09 danielweck

This is a "no fix". There is simply no way to prevent X11 from copying text into its buffer when selecting and pasting when middle clicking (unless we disable text selection altogether, which is a big no-no with respect to accessibility, and other features that depend on text being selectable).

danielweck avatar Aug 26 '22 18:08 danielweck