naelstrof / maim

maim (make image) takes screenshots of your desktop. It has options to take only a region, and relies on slop to query for regions. maim is supposed to be an improved scrot.
Other
2.15k stars 78 forks source link

Can only paste screenshots sometimes. #211

Open eob2000 opened 4 years ago

eob2000 commented 4 years ago

So i'm running Kubuntu 20.04 and after giving up trying to get spectacle to work as I want I've switched to maim and I'm having the strangest bug.

maim v5.5.3 (Latest on ubuntu repo)

I have two global shortcuts set up:

PrintScreen Key: maim -u | xclip -selection clipboard -t image/png Win+Shift+S: maim -s -u | xclip -selection clipboard -t image/png

Most of the time this works just fine and I can paste screenshots as I please, but occasionally I can't.

For example, if using my Win+Shift+S key combo I can take the following screenshot: image This pastes everywhere just fine

However, if I use Win+Shift+S to take THIS screenshot: image

I can ONLY seem to paste into seemingly web based things? (Discord and this issue editor both paste fine) But trying to paste into a libreoffice document or into telegram (Just something I happened to use) The first time it does nothing, the second time when I try to paste it pastes the last text on my clipboard.

I attempted to do some diagnosis and determined if I run the screenshot command in a terminal it initially runs fine, but then when I try to paste this gets printed:

image

I really can't figure out what's causing this, the only thing I can potentially think of is the amount of detail in the image? Notable times it fell down was screenshotting my plex library and screenshotting my google play books library, both times (Like the cake images example above) had lots of smaller thumbnails in them. But thats the only real link I can think of, that and they were all taken of chrome, however I can take screenshots of chrome just fine with other stuff on screen.

I read through some other issues but nothing seemed to exactly match the issue I was having.

Thanks in advance!

foxpy commented 4 years ago

That's not the maim's fault, as it just pipes image to standard output. The issue is somewhere between xclip and application you are pasting into.

naelstrof commented 4 years ago

Maybe you can try having maim output a different format than png.

Otherwise I'm unsure where a badwindow x exception would be in that pipeline... I would guess there's a bug in your window manager or desktop environment. You can try a different DE and see if that helps.

foxpy commented 4 years ago

There is a related bug in Qt. Apparently all Qt applications (including Telegram) suffer from clipboard issues: https://bugreports.qt.io/browse/QTBUG-56595