garbled output when pasting images from clipboard (also very slow)
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: treeshateorcs, Assigned: stransky, NeedInfo)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
Steps to reproduce:
1a. on wayland
cat image.png | wl-copy -t image/png
1b. on xorg
cat image.png | xclip -selection clipboard -t image/png
- ctrl+v on an imageboard such as kohlchan.net/int. it seems to work fine on imgur
Actual results:
https://i.imgur.com/vRovYCv.png
Expected results:
image is pasted and no output in the window it was pasted in
an excerpt of a mozregression log is attached
Hi,
Thanks for providing the mozregression log.
I don't have wayland or xorg on my end to test this, so as a starting point I'll add this ticket to the Core: Widget gtk product and hopefully someone with more knowledge in this area will look over it.
Regards,
Virginia
Assignee | ||
Comment 2•4 years ago
|
||
Do you see the same behavior on X11 and Wayland?
Reporter | ||
Comment 3•4 years ago
|
||
yes, same behavior on x11 and wayland
Assignee | ||
Comment 4•4 years ago
|
||
I wonder if that's https://gitlab.gnome.org/GNOME/mutter/-/issues/1160 but I see this one with Wayland only.
Comment 5•3 years ago
|
||
I have the same problem, but I use i3 instead, so I'm questioning about the relation with Mutter (but I use GDM3). I configured a series of keystrokes to do screenshots (gnome-screenshot is of the table, just pure execs of i3) using the tool maim to do the captures and piping for xclip to put in clipboard (not primary or secundary, clipboard itself). I tried to paste inside Google Images (which would result in a search for that image) and in the compose screen of Thunderbird (same backend, I guess, could be a hint too). I just got pure text, not the image as I supposed to expect. I also would like to mention I was able to paste the image inside Mattermost via Firefox (webapp). Here the issue related to Mattermost, so I think someone more experienced could find a hint. https://github.com/mattermost/mattermost-server/issues/14027
Assignee | ||
Comment 6•3 years ago
|
||
Can you run latest nightly on terminal with MOZ_LOG="WidgetClipboard:5" env variable set, reproduce the issue and attach the log here?
Thanks.
Comment 7•3 years ago
|
||
Here are the logs as requested: https://gist.github.com/mhalano/250eb15d0648a65cbe7ff3e2381a1464
It wasn't pasting anything now, not the image nor gibberish.
Assignee | ||
Comment 8•3 years ago
|
||
I see. from the log:
[Parent 250229: Main Thread]: D/WidgetClipboard nsRetrievalContextX11::GetClipboardText(clipboard)
[Parent 250229: Main Thread]: D/WidgetClipboard nsRetrievalContextX11::WaitForClipboardData
(firefox:250229): Gdk-WARNING **: 19:40:14.117: Error converting selection from UTF8_STRING
It looks like Gtk tries to convert image data to UTF8 - it looks like wrong MIME type is used.
btw. Which locale do you use?
Assignee | ||
Comment 9•3 years ago
|
||
Bug 1726516 may be related - I see the same log there.
Assignee | ||
Comment 10•3 years ago
|
||
BTW. can you reproduce it on Wayland too? If so can you please also attach log from MOZ_LOG="WidgetClipboard:5" ?
Comment 11•3 years ago
|
||
My locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=pt_BR.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=
Unfortunately, I don't think I can test with Wayland because I use i3, which is x11-exclusive. Sorry.
Assignee | ||
Comment 12•3 years ago
|
||
Okay, and are there any reproduction steps? the ones from https://bugzilla.mozilla.org/show_bug.cgi?id=1611407#c0 does not work for me.
Bug 1726516 may be related - maybe wrong image mime type is in clipboard and Firefox tries to convert image data to text?
Comment 13•3 years ago
|
||
I did the same using xclip. Both from a pre-existant png file and from a screen selection using maim
tool.
Assignee | ||
Comment 14•3 years ago
|
||
I'm sorry but I'm quite confused how this bug affects any real-life scenario. Does any application paste image data with wrong/unknown mime type and Firefox fails to paste it then? If so can you provide me step-by-step reproduction steps?
Thanks.
Comment 15•3 years ago
|
||
I use i3 as my window manager. I have some shortcuts where I use the maim
tool do to a capture of the screen or, mostly common, a selection of the screen. Sometimes (very frequently, actually) I have to paste this or in a Firefox screen (less common) or Thunderbird compose screen (most common). When I paste it, there are just gibberish, the text content of the image capture. Here is my shortcuts. You could execute on of them and try to paste to Firefox or, which I'm more costumed to, Thunderbird compose screen.
bindsym Ctrl+Print exec --no-startup-id maim | xclip -selection clipboard -t image/png
bindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png
bindsym Ctrl+$mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
Assignee | ||
Comment 16•3 years ago
|
||
Okay, I can reproduce with X11 backend. Wayland seems to be OK.
Assignee | ||
Comment 18•3 years ago
|
||
11 tries to convert clipboard data to requested MIME type which may lead to various errors so get clipboard content first and query only present clipboard data types.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 19•3 years ago
|
||
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/acf8d9448247 [Linux/X11] Don't try to get text clipboard data of binary MIME types, r=jhorak
Comment 20•3 years ago
|
||
bugherder |
Description
•