oleksis / youtube-dl-gui

A cross platform front-end GUI of the popular youtube-dl written in wxPython.
https://oleksis.github.io/youtube-dl-gui/
The Unlicense
1.71k stars 113 forks source link

Paste In URL Field Not Working on Linux Wayland #137

Open eddy-geek opened 1 year ago

eddy-geek commented 1 year ago

What is the purpose of your issue?

What operating system do you use ?

Fedora 38, Linux 6.2.15-300.fc38.x86_64 Wayland, KDE Plasma 5.27.4, Qt 5.15.9 Python 3.11.3 wxPython 4.2.0 yt-dlg 1.8.5 from pip

List of actions to perform to reproduce the problem:

  1. Try to paste with Ctrl-V, menu, or middle-click
  2. nothing happens

Similar symptoms to #122 but I checked paste works with the basic wxpython sample given in https://github.com/wxWidgets/Phoenix/issues/1391

So yt-dlg is doing something weird (maybe #123 regressed this particular environment? I am surprised there is a need for the custom _paste_from_clipboard code at all...)

eddy-geek commented 1 year ago

As a workaround, commenting the custom paste handler in mainframe.py#L407 works :)

        self._url_list = self._create_textctrl(
            wx.TE_MULTILINE | wx.TE_DONTWRAP, # self._on_urllist_edit
        )

No adverse effect that I can see.

(vim ~/.local/lib/python3.11/site-packages/youtube_dl_gui/mainframe.py +407)

oleksis commented 1 year ago

From where you install wxPython:

  1. from the system with dnf or using pip ?

  2. In this comment wxPython will need compiled with Unicode support . Can share the steps you follow to install yt-dlg

oleksis commented 1 year ago

I install Fedora Workstation 38 and follow your workaround

sudo dnf install python3-wxpython4
pip install yt-dlg

and Ctrl-V working OK. Can see the video demo:

https://github.com/oleksis/youtube-dl-gui/assets/44526468/08766014-7151-48c9-89e4-eb83665bca71

You can share more information to reproduce the error ?

oleksis commented 1 year ago

Wayland Primary Selection / Clipboard

It's about how Fedora 38 with KDE and Wayland implement Clipboard and Primary Selection

Doing the test, work with the settings

Open yt-dlg with the GDK_BACKEND environment variable

GDK_BACKEND=x11 yt-dlg

You can watch the following demo video using wxPython with KDE and Wayland

https://github.com/oleksis/youtube-dl-gui/assets/44526468/f21b9801-1c7a-4677-9880-fd823ed8bdac

oleksis commented 1 year ago

@eddy-geek Can test the yt-dlg version 1.8.6 ?

Install from GitHub

python3 -m pip install -U git+https://github.com/oleksis/youtube-dl-gui#egg=yt-dlg

Install from TestPyPI

python3 -m pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ yt-dlg
oleksis commented 1 year ago

Video demo:

https://github.com/oleksis/youtube-dl-gui/assets/44526468/1728028e-263f-4e00-9c5e-8ab120791b69