Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wayland] Failed to send all clipoard data to XWayland window #2233

Closed
ToxicMushroom opened this issue Jan 17, 2023 · 4 comments · Fixed by #2234
Closed

[Wayland] Failed to send all clipoard data to XWayland window #2233

ToxicMushroom opened this issue Jan 17, 2023 · 4 comments · Fixed by #2234
Labels
bug Wayland Relates to Wayland protocol

Comments

@ToxicMushroom
Copy link

Describe the bug
When trying to paste large images, copyq shows a warning after pasting the first 65536 (2^16) bytes

To Reproduce
Steps to reproduce the behavior:

  1. Copy an image larger than +- 66KB
  2. Double click the copyq entry to select the entry for pasting
  3. Try to paste the image in a program that runs via XWayland (e.g. gimp)

Expected behavior
The full image is pasted like when copying straigh from source to the XWayland program.

Screenshots
Demonstration.
https://user-images.githubusercontent.com/32853531/212791020-7f8a2788-5937-4cab-98f2-9748a086e9fe.mp4

copyq log
merlijn@arch ~ % copyq
Warning: [qt.qpa.wayland] QtWarning: Wayland does not support QWindow::requestActivate()
Warning: [default] QtWarning: Failed to send all clipobard data; sent 65536 bytes out of 1686475
Warning: [qt.qpa.wayland] QtWarning: Wayland does not support QWindow::requestActivate()
Warning: [default] QtWarning: Failed to send all clipobard data; sent 65536 bytes out of 1686475
env
LOGNAME=merlijn
MAIL=/var/spool/mail/merlijn
MOTD_SHOWN=pam
MOZ_ENABLE_WAYLAND=1
OLDPWD=/home/merlijn/example
PAGER=less
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/home/merlijn/.dotnet/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PWD=/home/merlijn
QT_QPA_PLATFORM=wayland
SDL_VIDEODRIVER=wayland
SHELL=/bin/zsh
SHLVL=2
SWAYSOCK=/run/user/1000/sway-ipc.1000.586.sock
SYSTEMD_EXEC_PID=543
TERM=alacritty
USER=merlijn
WAYLAND_DISPLAY=wayland-1
WINDOWID=94412397509648
XCURSOR_SIZE=24
XDG_ACTIVATION_TOKEN=f57c22d4e2e4084ce93c3a7d5e0a162a
XDG_CURRENT_DESKTOP=sway
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=sway
XDG_SESSION_ID=1
XDG_SESSION_TYPE=wayland
XDG_VTNR=1
_=/usr/bin/env
_JAVA_AWT_WM_NONREPARENTING=1
LC_MESSAGES=

Version, OS and Environment

  • CopyQ Clipboard Manager 6.3.2
  • Qt: 5.15.6
  • KNotifications: 5.98.0
  • Compiler: GCC
  • Arch: x86_64-little_endian-lp64
  • OS: Arch Linux
  • OS [e.g. Windows]
  • DE: sway version 1.8

Additional context
This issue does not occur when using QT_QPA_PLATFORM=xbc or when pasting into wayland native programs.
I tried an online image editor on ungoogled-chromium under XWayland and native to deduce the above.
However due to #2224 using this workaround under wayland is undesirable.

@hluk
Copy link
Owner

hluk commented Jan 18, 2023

Similar problem with Krita. Seem that it could be a problem with XWayland integration. Not sure if I can fix that in CopyQ.

@hluk hluk added the Wayland Relates to Wayland protocol label Jan 18, 2023
@hluk
Copy link
Owner

hluk commented Jan 18, 2023

All works if I pass the image data to wl-copy instead:

copyq clipboard image/png | wl-copy --type image/png

There is some problem passing the data via pipe (it gets interrupted after 64k is written - buffer size?):

const qint64 written = c.write(m_data);

@hluk
Copy link
Owner

hluk commented Jan 18, 2023

I checked the how wl-copy implements sending the data and it seems CopyQ is missing fcntl(fd, F_SETFL, 0) for the pipe.

@hluk
Copy link
Owner

hluk commented Jan 18, 2023

Thanks for the detailed report. I will release the fix in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Wayland Relates to Wayland protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants