Copyq: Wayland: No clipboard content

Created on 27 Oct 2019  路  18Comments  路  Source: hluk/CopyQ

copyq
copyq
copyq

Describe the bug
A clear and concise description of what the bug is.
copy some text from different sources, try to read the content of clipboard in CopyQ, nothing.
To Reproduce
Steps to reproduce the behavior:

  1. Go to '.some text..'
  2. Click on 'ctrl c...'
  3. Scroll down to '...'
  4. See nothing in copyq

Expected behavior
A clear and concise description of what you expected to happen.
content from clipboard in copyq
Screenshots
If applicable, add screenshots to help explain your problem.
CopyQ
Clipboard Manager
v3.9.2
Version, OS and Environment Fedora 31 beta

  • Desktop environment, window manager (if applicable) GNOME

Additional context
Add any other context about the problem here.
on trying to start copyq in terminal " Warning: CopyQ server is already running."

bug

Most helpful comment

Workaround is to set QT_QPA_PLATFORM environment variable and use Xwayland (xorg-x11-server-Xwayland fedora package) to handle X11 apps.

E.g. launch CopyQ with:

env QT_QPA_PLATFORM=xcb copyq

If CopyQ autostarts, you can change Exec=... line in ~/.config/autostart/copyq.desktop:

Exec=env QT_QPA_PLATFORM=xcb copyq

All 18 comments

What do you mean by "See nothing in copyq"? Can you be more specific?

Today copyq will not start, I would like to use it.
I remove copyq from PC (Fedora 31 beta)
and install new.
try to open copyq. Click on icon and nothing happens.
type copyq in terminal message: Warning: CopyQ server is already running.
GUI of copyq opens when I type in terminal
It says <0> EMPTY
I copy a text (select and CTRL-C)
after that in GUI of copyq I open Show Clipboard Content, a new window opens. without any content.

If CopyQ is running, you can run copyq show to show the main window.

Run copyq logs|tail -50 to list recent logs. There might be some warnings or errors.

copyq logs|tail -50
CopyQ Warning [2019-10-28 06:44:45.887] : Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-28 06:44:47.314] : Null data in selection.
CopyQ Warning [2019-10-28 06:44:47.314] : Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-28 06:46:31.757] : CopyQ server is already running.
CopyQ ERROR [2019-10-28 06:47:18.197] : Null data in selection.
CopyQ Warning [2019-10-28 06:47:18.197] : Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-28 06:47:26.896] : Null data in selection.
CopyQ Warning [2019-10-28 06:47:26.896] : Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-28 06:47:26.896] : Null data in selection.
CopyQ Warning [2019-10-28 06:47:26.896] : Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-28 06:47:27.848] : Null data in selection.
CopyQ Warning [2019-10-28 06:47:27.848] : Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-28 06:47:29.275] : Null data in selection.
CopyQ Warning [2019-10-28 06:47:29.275] : Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-28 06:50:47.966] : CopyQ server is already running.
CopyQ Warning [2019-10-28 06:51:35.903] : CopyQ server is already running.
CopyQ Warning [2019-10-28 08:13:05.015] : CopyQ server is already running.
CopyQ ERROR [2019-10-28 14:32:34.037] : Null data in selection.
CopyQ Warning [2019-10-28 14:32:34.038] : Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-28 14:32:34.038] : Null data in selection.
CopyQ Warning [2019-10-28 14:32:34.038] : Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-28 14:32:35.090] : Null data in selection.
CopyQ Warning [2019-10-28 14:32:35.090] : Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-28 14:32:36.667] : Null data in selection.
CopyQ Warning [2019-10-28 14:32:36.667] : Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-28 14:32:40.413] : CopyQ server is already running.
CopyQ Warning [2019-10-28 14:33:47.563] : CopyQ server is already running.
CopyQ Warning [2019-10-28 14:34:19.202] : CopyQ server is already running.
CopyQ Warning [2019-10-28 14:34:38.191] : CopyQ server is already running.
CopyQ ERROR [2019-10-28 20:57:15.940] : QtFatal: The Wayland connection broke. Did the Wayland compositor die? (:0, )
CopyQ ERROR [2019-10-29 14:21:08.766] : Null data in selection.
CopyQ Warning [2019-10-29 14:21:08.774] : Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-29 14:21:08.774] : Null data in selection.
CopyQ Warning [2019-10-29 14:21:08.774] : Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-29 14:21:09.726] : Null data in selection.
CopyQ Warning [2019-10-29 14:21:09.726] : Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-29 14:21:11.208] : Null data in selection.
CopyQ Warning [2019-10-29 14:21:11.208] : Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-29 14:22:05.585] : CopyQ server is already running.
CopyQ ERROR [2019-10-29 16:06:02.923] : QtFatal: The Wayland connection broke. Did the Wayland compositor die? (:0, )
CopyQ ERROR [2019-10-30 15:02:50.435] : Null data in selection.
CopyQ Warning [2019-10-30 15:02:50.435] : Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-30 15:02:50.435] : Null data in selection.
CopyQ Warning [2019-10-30 15:02:50.436] : Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-30 15:02:51.386] : Null data in selection.
CopyQ Warning [2019-10-30 15:02:51.386] : Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-30 15:02:52.812] : Null data in selection.
CopyQ Warning [2019-10-30 15:02:52.812] : Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-30 15:03:29.529] : CopyQ server is already running.
CopyQ Warning [2019-10-30 15:06:15.425] : CopyQ server is already running.

Looks like CopyQ cannot access clipboard for some reason -- or more specifically mouse selection. It seems you are running Wayland (as opposed to X11) and I thought it doesn't support selection.

You can try disabling all options under "Clipboard Manipulation" except "Store Clipboard" in CopyQ configuration:

image

That is unfortunately not working neither.

CopyQ Warning [2019-10-31 16:13:56.013] <Server-1796987>: Failed to set global shortcut "Ctrl+Shift+G" for command "Google".
CopyQ ERROR [2019-10-31 16:13:56.085] <monitorClipboard-1796997>: Null data in selection.
CopyQ Warning [2019-10-31 16:13:56.085] <monitorClipboard-1796997>: Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-31 16:13:56.085] <monitorClipboard-1796997>: Null data in selection.
CopyQ Warning [2019-10-31 16:13:56.086] <monitorClipboard-1796997>: Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-31 16:13:57.114] <monitorClipboard-1796997>: Null data in selection.
CopyQ Warning [2019-10-31 16:13:57.115] <monitorClipboard-1796997>: Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-31 16:13:58.615] <monitorClipboard-1796997>: Null data in selection.
CopyQ Warning [2019-10-31 16:13:58.615] <monitorClipboard-1796997>: Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-31 16:14:44.884] <Server-1798041>: CopyQ server is already running.
CopyQ Warning [2019-10-31 16:15:22.008] <Server-1796987>: Failed to set global shortcut "Ctrl+Shift+G" for command "Google".
CopyQ ERROR [2019-10-31 16:15:22.069] <monitorClipboard-1798772>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:22.069] <monitorClipboard-1798772>: Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-31 16:15:22.070] <monitorClipboard-1798772>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:22.070] <monitorClipboard-1798772>: Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-31 16:15:23.122] <monitorClipboard-1798772>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:23.122] <monitorClipboard-1798772>: Failed to retrieve selection data (try 3/3)
CopyQ Warning [2019-10-31 16:15:23.673] <Server-1796987>: Failed to set global shortcut "Ctrl+Shift+G" for command "Google".
CopyQ ERROR [2019-10-31 16:15:23.790] <monitorClipboard-1798834>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:23.790] <monitorClipboard-1798834>: Failed to retrieve selection data (try 1/3)
CopyQ ERROR [2019-10-31 16:15:23.790] <monitorClipboard-1798834>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:23.790] <monitorClipboard-1798834>: Failed to retrieve selection data (try 2/3)
CopyQ ERROR [2019-10-31 16:15:24.742] <monitorClipboard-1798834>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:24.743] <monitorClipboard-1798834>: Failed to retrieve selection data (try 3/3)
CopyQ ERROR [2019-10-31 16:15:26.168] <monitorClipboard-1798834>: Null data in selection.
CopyQ Warning [2019-10-31 16:15:26.169] <monitorClipboard-1798834>: Failed to retrieve selection data (try 3/3)

Oh, sorry, I pasted wrong screenshot. The configuration to avoid checking mouse selection should be like this:

image

@rgarcia89 Can you please check again?

Doesn't work neither. It is also not able to set the shortcuts like you can see here

 Failed to set global shortcut "Ctrl+Shift+G" for command "Google".

It is also not able to set the shortcuts like you can see here

Setting global shortcuts in Wayland is not supported (not sure if they already have a generic API for it).

So this means that nothing of copyq is currently usable under fedora 31 and wayland... Thats really bad 馃檲

So this means that nothing of copyq is currently usable under fedora 31 and wayland... Thats really bad see_no_evil

I'm going to update to F31 soon and see if Wayland is finally usable for me. I'll try to fix these issues while I'm at it. :)

OK, I've upgraded to F31.

Looks like it's not possible to access clipboard with Qt unless the window requesting the access is focused.

This is also somewhat related: Custom notifications (a "tooltip" window) gets focused when they pop up and it doesn't seem to be possible to show them without focus (I messed around with window attributes). Couple of other Qt applications are broken because they use some special window behaviors (e.g. smplayer cannot embed video player window, konsole doesn't show menus).

It could be a bug in Gnome.

Below is short snippet to test the clipboard access (uses PyQt5). If you click "Update" button it gets formats currently in clipboard. Clicking "Get" gets the selected format. You can select the format in combo box, but opening the combo list somehow breaks clipboard access so Get and Update buttons no longer work unless the window is deactivated and activated again.

#!/usr/bin/env python3
import sys

from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets

app = QtWidgets.QApplication(sys.argv)


def update_format_list(combo):
    combo.clear()
    data = app.clipboard().mimeData()
    for mime in data.formats():
        combo.addItem(mime)


def get_format(combo, label):
    mime = combo.currentText()
    data = app.clipboard().mimeData().data(mime)
    if mime.startswith('image'):
        image = QtGui.QImage.fromData(data)
        pixmap = QtGui.QPixmap.fromImage(image)
        label.setPixmap(pixmap)
    else:
        text = data.data().decode()
        label.setText(text)


combo = QtWidgets.QComboBox()
update_format_list(combo)

label = QtWidgets.QLabel()
label.setAlignment(QtCore.Qt.AlignCenter)

get_button = QtWidgets.QPushButton('&Get')
get_button.clicked.connect(lambda: get_format(combo, label))

update_button = QtWidgets.QPushButton('&Update')
update_button.clicked.connect(lambda: update_format_list(combo))

hlayout = QtWidgets.QHBoxLayout()
hlayout.addWidget(combo, stretch=1)
hlayout.addWidget(get_button)
hlayout.addWidget(update_button)

vlayout = QtWidgets.QVBoxLayout()
vlayout.addLayout(hlayout)
vlayout.addWidget(label)

window = QtWidgets.QWidget()
window.setLayout(vlayout)

window.show()
app.exec_()

Workaround is to set QT_QPA_PLATFORM environment variable and use Xwayland (xorg-x11-server-Xwayland fedora package) to handle X11 apps.

E.g. launch CopyQ with:

env QT_QPA_PLATFORM=xcb copyq

If CopyQ autostarts, you can change Exec=... line in ~/.config/autostart/copyq.desktop:

Exec=env QT_QPA_PLATFORM=xcb copyq

@hluk this way copied text is stored in copyq. The only thing not working right now is storing text selected by the mouse. Thanks figuring out that workaround

The only thing not working right now is storing text selected by the mouse.

@rgarcia89 Mouse selections should work only from other X11 apps. AFAIK, Wayland doesn't support them.

See also: https://wiki.gnome.org/Initiatives/Wayland/PrimarySelection

I use Arch Linux with Sway. After the last update all the above described behavior happens here too now.

if I launch in this way works:

E.g. launch CopyQ with:

env QT_QPA_PLATFORM=xcb copyq

if I add in desktop file doesn't works

Exec=env QT_QPA_PLATFORM=xcb copyq

fedora 33 any clue?

Regards.,

For Fedora (32 and 33), there is development package with much better Wayland support.

You can install the package using:

sudo dnf install 'dnf-command(copr)'
sudo dnf copr enable lholecek/copyq
sudo dnf install copyq
Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidawad picture davidawad  路  9Comments

beefeater7 picture beefeater7  路  8Comments

nmat picture nmat  路  6Comments

orschiro picture orschiro  路  7Comments

eera5607 picture eera5607  路  7Comments