hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.52k stars 439 forks source link

copy items are not saved, log: "Clipboard unchanged, selection unchanged. Test again in 0ms." #1505

Open arbach opened 3 years ago

arbach commented 3 years ago

the bug copyq starts and works properly on ubuntu, randomly after a day or two without restarting, maybe after suspend, copyq stops saving the clipboard entries. The issue is only resolved after restart. Stopping and starting copyq doesn't resloved it. even if the configuration folder is completely removed

To Reproduce

  1. start copyq on ubuntu
  2. wait few days without restarting
  3. Copy anything to clipboard, using any tools, mouse, keyboard or xclip
  4. The item is not saved in copyq

Everything in the log seems normal, except nothing happen when copying to clipboard.

Version, OS and Environment Ubuntu 20.04 LTS copyq 3.12.0 Additional context Tried disable and enabled "Clipbaoard storing" did not help

When watching the logs, I got the following when I click "ctl+c"

: Clipboard unchanged, selection unchanged. Test again in 0ms.

Debug logo

`DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 645x421,673,343 -> 645x421,267,301 DEBUG: Focus window is " hh " DEBUG: Loading configuration DEBUG: Configuration loaded DEBUG: Starting monitor DEBUG: Executing: copyq --clipboard-access monitorClipboard DEBUG: Starting callback: onStart DEBUG: Executing: copyq onStart DEBUG: Got save state request from session manager. DEBUG: Focus window is " hh " DEBUG: Updating tray menu DEBUG: Tab "&clipboard": Loading items DEBUG: Tab "&clipboard": 2338 items loaded DEBUG: Executing: copyq eval -- runMenuCommandFilters() DEBUG: Updating tray menu DEBUG: Focus window is "copyq not saving clipboard - Google Search - Brave" DEBUG: Geometry: Window "ConfigurationManager": Restore geometry "Options/ConfigurationManager_geometry": 679x621,656,243 -> 1049x621,327,211 DEBUG: Focus window is "Configuration — CopyQ" DEBUG: Focus window is "copyq not saving clipboard - Google Search - Brave" DEBUG: Terminating monitor DEBUG: Executing: copyq eval -- setTitle(); showDataNotification() DEBUG: Clipboard monitoring disabled. DEBUG: Monitor finished DEBUG: Raising window "copyq not saving clipboard - Google Search - Brave" DEBUG: Focus window is "copyq not saving clipboard - Google Search - Brave" DEBUG: Focus window is "copyq not saving clipboard - Google Search - Brave" DEBUG: Starting monitor DEBUG: Executing: copyq --clipboard-access monitorClipboard DEBUG: Clipboard monitoring enabled. DEBUG: Raising window "copyq not saving clipboard - Google Search - Brave" DEBUG: Focus window is "copyq not saving clipboard - Google Search - Brave" DEBUG: Executing: Command "Show/hide main window" DEBUG: Focus window is " hh " DEBUG: Raising window "CopyQ" DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 645x421,673,343 -> 645x421,267,301 DEBUG: Saving items on application state change (2) DEBUG: Focus window is " hh " DEBUG: Focus window is "New Issue · hluk/CopyQ - Brave" DEBUG: Raising window "New Issue · hluk/CopyQ - Brave"

`

hluk commented 3 years ago

Looks like duplicate of #1500. Was it closed by a mistake?

arbach commented 3 years ago

No, I closed that and opened clean version here since we know what is the issue. so we don't have people going through unnecessary details.

arbach commented 3 years ago

Bump.

garytechlead commented 3 years ago

I am having the same issue

arbach commented 2 years ago

This issue still exist with v 5.0, clipboard is not registered in copyq.

arbach commented 2 years ago

@hluk any clues on how to debug this further ?

copyq spontaneously stop storing data copied to clipboard, but then start working again. maybe between OS suspends.

arbach commented 2 years ago

Screen shoot from watch -n0.1 tail copyq.log error

With this nothing is stored in copyq

I get this message everytime I copy something to the clipboard

hluk commented 2 years ago

What's your desktop environment and window manager? Are you using Wayland instead of X11?

Is this perhaps happening only when copying from a specific app?

arbach commented 2 years ago

Ubuntu 20.04 LTS with x11.

cat /etc/X11/default-display-manager /usr/sbin/gdm3

loginctl show-session 1 -p Type Type=x11

copyq either works everywhere, or doesn't work at all anywhere. I am suspecting this happen between suspends. Randomly when I bring laptop out of suspends, copyq works or doesn't work. but mostly doesn't work.

It always works after OS restart.

arbach commented 2 years ago

@hluk

Something is not starting properly after suspension sometimes. But even if I kill and start again it doesn't work. The only sure way to make work is to restart the machine. or keep trying suspending multiple times until it works.

Is there another way to restart ?

This is what I tried and did not work

copyq exit export COPYQ_LOG_LEVEL='DEBUG' export COPYQ_LOG_FILE="/tmp/copyq.log" copyq

or with killall

if it's not working there is no way to make it work unless I restart the machine.

When it is working it work perfectly, selection is stored properly, and everything copied both from UI and command line is stored properly.

arbach commented 2 years ago

@hluk

hluk commented 2 years ago

I'm guessing this is a bug in Qt. There is a similar issues already filed: https://bugreports.qt.io/browse/QTBUG-71961

arbach commented 2 years ago

what is an effective way to restart as work around ? restarting copyq did not resolve the issue.

hluk commented 2 years ago

restarting copyq did not resolve the issue.

Can you install most recent version (5.0.0)? It can be installed from PPA: https://copyq.readthedocs.io/en/latest/installation.html

Also, please check if the app can still access current clipboard content - you can display the clipboard with Ctrl+Shift+C from the main application window.

arbach commented 2 years ago

I am already on 5.0.0

Yes, app can access the content, but it's not stored.

Almost confirmed the issue is after suspend. As you can see the first copy was stored properly. After I suspended and resumed, the "test content" was not stored.

test content

hluk commented 2 years ago

I guess the clipboard in Qt can no longer detect changes for some reason. I don't think I can fix that in the app.

You can also try using the Flatpak version of the app - which should be using some newer Qt libraries - but I'm a bit skeptical it will change anything.

arbach commented 2 years ago

Is there anything I can do to make it work other than restarting the whole machine ?

hluk commented 2 years ago

I would expect that restarting the app would fix this if the problem is in Qt. Something in the desktop environment might be broken. I guess logging out and in again would also work.

Unfortunately, I don't have a good suggestion. You can try updating the system packages, changing desktop environment, look up problems in system logs (e.g. journalctl -xe).