BUG FIX for the Clipboard copy function

Hi Dillo devs! Here is just a small bug fix for the Cipboard copy function. The 3rd argument passed for the Fl::copy() function should be 1 (not 0) for it to copy the input text to the clipboard buffer. This issue is found at line 702 of file dillo/dw/fltkplatform.cc: [code] void FltkPlatform::copySelection(const char *text) { Fl::copy(text, strlen(text), 0); // wrong } [/code] Change it to: [code] void FltkPlatform::copySelection(const char *text) { Fl::copy(text, strlen(text), 1); } [/code] Ref: FLTK Documentation: https://www.fltk.org/doc-1.3/group__fl__clipboard.html#ga221bc2fa9bd737a8259...

Hi, On Tue, Aug 20, 2024 at 04:01:09PM +0200, Batavo Silva wrote:
Hi Dillo devs! Here is just a small bug fix for the Cipboard copy function. The 3rd argument passed for the Fl::copy() function should be 1 (not 0) for it to copy the input text to the clipboard buffer.
This is not a bug, it follows the primary selection behavior of X11 programs. We should add another way to copy the selection to the clipboard with Control+C (and paste with Control+V) and from the context menu, like other programs do. See: https://github.com/dillo-browser/dillo/issues/228 Best, Rodrigo.

Sorry about that guys! The correct value should be 2, not 1. This solved the problem here. I'm on Linux running LXDE desktop environment. Could you guys test it? [code] void FltkPlatform::copySelection(const char *text) { Fl::copy(text, strlen(text), 2); } [/code]

Hi, On Tue, 20 Aug 2024 17:33:24 -0000 batavinho@mail.com wrote:
Sorry about that guys! The correct value should be 2, not 1. This solved the problem here. I'm on Linux running LXDE desktop environment.
Could you guys test it? [code] void FltkPlatform::copySelection(const char *text) { Fl::copy(text, strlen(text), 2); } [/code]
This still breaks the existing functionality. It may act as a workaround for you, but as Rodrigo mentioned, the correct solution is to implement a better copy feature. In the meantime, you may want to experiment with using the middle-click selection paste feature, its very useful. -Alex

Hi Batavo, On Tue, 20 Aug 2024 16:01:09 +0200 Batavo Silva <batavinho@mail.com> wrote:
Hi Dillo devs! Here is just a small bug fix for the Cipboard copy function. The 3rd argument passed for the Fl::copy() function should be 1 (not 0) for it to copy the input text to the clipboard buffer.
This issue is found at line 702 of file dillo/dw/fltkplatform.cc: [code] void FltkPlatform::copySelection(const char *text) { Fl::copy(text, strlen(text), 0); // wrong } [/code]
Change it to: [code] void FltkPlatform::copySelection(const char *text) { Fl::copy(text, strlen(text), 1); } [/code]
Ref: FLTK Documentation: https://www.fltk.org/doc-1.3/group__fl__clipboard.html#ga221bc2fa9bd737a8259...
Unfortunately your above change breaks the selection buffer. For example, currently when I select some text with the mouse, then I can middle-click paste that text into any text input box. That no longer works with your change. Regards, Alex
participants (4)
-
a1ex@dismail.de
-
batavinho@mail.com
-
Batavo Silva
-
Rodrigo Arias