Describe the bug
Around 30% of the time when I bring up CopyQ's paste window, the receiving app crashes, pulling down a few other apps. Sometimes all processes crash, sometimes only the window that was last focused.
Same happens when CopyQ window is successfully opened, and I select an entry. Just as I select it, CopyQ crashes together with the receiving app and some others.
As I mostly paste to firefox, that's where I had most of the crashes, but it also happened in some electron apps.
The crash is not just killing the receiving app, but it somehow makes it impossible to start the crashed app again. Immediately after crashing, in my surviving terminal I can try to start the crashed program again (e.g. firefox) and the command just gets stuck, nothing happens, no logs output anywhere, it's just blocked.
I have been noticing this for over a month, I've updates all software to latest versions, and I have found no other combination of software or commands used or provoking such a crash.
When it crashes, logs of my DE sway show A LOT of errors:
[2020-07-27 17:49:56.813] [error] Window: Invalid IPC magic
To Reproduce
Steps to reproduce the behavior:
swayfirefoxcopyq and try to paste an entry to firefoxExpected behavior
CopyQ pastes the selected entry to the receiving app
Version, OS and Environment
CopyQ Clipboard Manager v3.12.0
Qt: 5.15.0
Compiler: GCC
Arch: x86_64-little_endian-lp64
OS: Arch Linux
DE: SwayWM (Wayland)
Additional context
CopyQ crash log:
unset QT_QPA_PLATFORMTHEME && env WAYLAND_DEBUG=1 QT_QPA_PLATFORM=xcb COPYQ_LOG_LEVEL=DEBUG COPYQ_LOG_FILE=~/copyq.$(date +"%Y-%m-%d").log copyq 2>&1 &
DEBUG: Server "/home/nikola/.config/copyq/.copyq_s" started.
DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 645x421,637,329 -> 949x1034,963,20
DEBUG: Loading configuration
DEBUG: Configuration loaded
DEBUG: Starting monitor
DEBUG: Executing: copyq --clipboard-access monitorClipboard
DEBUG: Starting callback: onStart
DEBUG: Executing: copyq onStart
DEBUG: Updating tray menu
DEBUG: Tab "&clipboard": Loading items
DEBUG: Tab "&clipboard": 1176 items loaded
DEBUG: Executing: copyq eval -- runMenuCommandFilters()
DEBUG: Updating tray menu
...
...
...
DEBUG: Raising window "node dist/src/generate-client…e" --testParadigms "mt","ptt" — CopyQ"
DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 631x1034,644,23 -> 949x1034,963,20
DEBUG: Raising window "Confluence - Mozilla Firefox"
DEBUG: Pasting item from main window to "Confluence - Mozilla Firefox".
DEBUG: Updating tray menu
DEBUG: Focus window is "Confluence - Mozilla Firefox"
DEBUG: Executing: copyq onOwnClipboardChanged
DEBUG: Executing: copyq onOwnClipboardChanged
DEBUG: Saving items on application state change (2)
DEBUG: Tab "&clipboard": Saving 1174 items
DEBUG: Tab "&clipboard": Items saved
DEBUG: Focus window is "Confluence - Mozilla Firefox"
DEBUG: Executing: copyq onClipboardChanged
DEBUG: Executing: Command "Show/hide main window"
DEBUG: Focus window is "nikola.online.kdbx [Locked] - KeePassXC"
DEBUG: Raising window "node dist/src/generate-c…le --copyToResearch \... (4 lines) — CopyQ"
DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 631x1034,644,23 -> 949x1034,963,20
DEBUG: Raising window "nikola.online.kdbx [Locked] - KeePassXC"
DEBUG: Pasting item from main window to "nikola.online.kdbx [Locked] - KeePassXC".
DEBUG: Focus window is "nikola.online.kdbx [Locked] - KeePassXC"
DEBUG: Executing: copyq onClipboardUnchanged
DEBUG: Executing: copyq onOwnClipboardChanged
DEBUG: Saving items on application state change (2)
DEBUG: Focus window is "nikola.online.kdbx [Locked] - KeePassXC"
DEBUG: Executing: copyq onClipboardChanged
DEBUG: New item: Adding
DEBUG: Updating tray menu
DEBUG: Focus window is "Portal for Partners - Mozilla Firefox"
DEBUG: Executing: Command "Show/hide main window"
DEBUG: Focus window is "Portal for Partners - Mozilla Firefox"
DEBUG: Raising window ""testEnvironment": "node",... (6 lines) — CopyQ"
DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 703x924,608,78 -> 949x1034,963,20
DEBUG: Raising window "Portal for Partners - Mozilla Firefox"
DEBUG: Pasting item from main window to "Portal for Partners - Mozilla Firefox".
DEBUG: Focus window is "Portal for Partners - Mozilla Firefox"
DEBUG: Saving items on application state change (2)
DEBUG: Tab "&clipboard": Saving 1175 items
DEBUG: Tab "&clipboard": Items saved
DEBUG: Focus window is "Portal for Partners - Mozilla Firefox"
DEBUG: Executing: Command "Show/hide main window"
DEBUG: Focus window is "Portal for Partners - Mozilla Firefox"
DEBUG: Raising window ""testEnvironment": "node",... (6 lines) — CopyQ"
DEBUG: Geometry: Window "MainWindow": Restore geometry "Options/MainWindow_geometry": 631x1034,644,23 -> 949x1034,963,20
DEBUG: QtWarning: The X11 connection broke: I/O error (code 1) (:0, )
XIO: fatal IO error 2 (No such file or directory) on X server ":0"
after 24480 requests (24480 known processed) with 0 events remaining.
[1] + 137830 exit 1 env WAYLAND_DEBUG=1 QT_QPA_PLATFORM=xcb COPYQ_LOG_LEVEL=DEBUG copyq 2>&1 >
My sway logs...
env WAYLAND_DEBUG=1 sway 2>&1 >~/sway.log
sway.log.2020-08-12.log
sway.log.2020-08-14.log
sway.log.2020-07-27.log
sway.log.2020-07-28.log
sway.log.2020-07-28.2.log
What I have tried:
copyq with unset QT_QPA_PLATFORMTHEME and with envvar QT_QPA_PLATFORM=xcb and all variations of those twoThat looks like a bug in Sway.
See also the Wayland support issue: #27
I suggest turning off "Focus last window" and "Paste to last window" in configuration (History tab):

I suggest turning off "Focus last window" and "Paste to last window" in configuration (History tab):
Actually, I think this helps.. I will test it out for a few days more, but so far looks good! Thank you so much for your help! It's a real pain to lose progress on all running applications.
That looks like a bug in Sway.
See also the Wayland support issue: #27
Totally missed out this comment https://github.com/hluk/CopyQ/issues/27#issuecomment-418779946 and that there are settings to check it on/off..
Most helpful comment
I suggest turning off "Focus last window" and "Paste to last window" in configuration (History tab):