microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copy/Paste from far2l (wxWidgets GUI) to Telegram Desktop not working

unxed opened this issue · comments

Windows build number:

10.0.22631.3296

Your Distribution version:

Ubuntu 23.10

Your WSL versions:

WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3296

Steps to reproduce:

  1. Install far2l-gui from ppa:
    https://launchpad.net/~far2l-team/+archive/ubuntu/ppa
  2. Install Telegram Desktop
    https://desktop.telegram.org/
    (Linux version)
  3. Run far2l like this:
FAR2L_WSL_NATIVE=1 far2l
  1. Try to copy some text from far2l gui to Telegram Desktop

WSL logs:

No response

WSL dumps:

No response

Expected behavior:

Then I copy text from far2l (Linux port of Far Manager, gui wxWidgets-based version), to Telegram Desktop, text should be copied fine.

Actual behavior:

Then I copy text from far2l (Linux port of Far Manager, gui wxWidgets-based version), to Telegram Desktop, text is not copied at all.

In native Ubuntu 23.10 such copy-paste works fine.

far2l ppa
https://launchpad.net/~far2l-team/+archive/ubuntu/ppa

far2l sources
https://github.com/elfmz/far2l

Telegram Desktop
https://desktop.telegram.org/

Related far2l issue:
elfmz/far2l#1658

It's worth nothing that even a very simple call to gtk fails to place the text in the Windows clipboard:

    GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
    gtk_clipboard_set_text(clipboard, "Hello World!", -1);

wxWidgets/wxWidgets#23544 (comment)

Implemented workaround on our side.
Please run

FAR2L_WSL_NATIVE=1 far2l

to reproduce the bug after this PR is accepted

Also please note that even with GDK_BACKEND=x11 clipboard has problems under wslg under Wayland: you can't copy/paste multi line text. I guess that some kind of \n -> \r\n conversion and vice versa should be added, but I am not actually sure.