[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libreoffice-design] Fwd: How do various apps and DEs handle the primary selection?

Forgot to CC design. Please reply also on the dev list.

-------- Weitergeleitete Nachricht --------
Betreff: How do various apps and DEs handle the primary selection?
Datum: Mon, 8 Jul 2019 01:07:38 +0200
Von: Jan-Marek Glogowski <glogow@fbihome.de>
An: libreoffice-dev <LibreOffice@lists.freedesktop.org>


I'm trying to gather information how various apps handle the primary selection,
so I can fix tdf#104717 [1]. There is already a patch for that in Gerrit[2].

The KDE applications I tested keep the primary alive, while they are running and
just clear it when they close. So I can select some text in kate and it'll stay
in the primary even, if I close the document containing the selected text.

AFAIK at least Writer, Calc and Draw use TransferableHelper::ClearSelection to
clear the selection. Writer clears the selection in many more places then either
Calc or Draw. See

$ git grep -B 5 -A 5 SwTransferable::ClearSelection sw

And Writer clears it when a Shell closes, while Calc (~ScTabView) and Draw
(:~View) clear it when the view is closed. But I'm a bit confused by the terms
Shell and View and then there is even a ViewShell...

IMHO we shouldn't handle the primary selection lifetime different from the
clipboard lifetime. When selecting stuff, the primary should stay alive, even if
I close the document or module, just like the normal clipboard. I don't see a
point of clearing the selection at all, except on application shutdown, when the
application won't be able to serve it anymore.

How do other applications you know handle the primary selection?


P.S. I use

$ watch -n 1 "xclip -selection clipboard -out; echo; xclip -selection primary -out"

to monitor the clibboard status. And if you want to test stuff, be sure to
disable clipboard managers, as these often copy stuff between the different
clipboards, also resulting in tdf#104717.

[1] https://bugs.documentfoundation.org/show_bug.cgi?id=104717
[2] https://gerrit.libreoffice.org/#/c/73906/
LibreOffice mailing list

To unsubscribe e-mail to: design+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/design/
Privacy Policy: https://www.documentfoundation.org/privacy

Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.