flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
25.01k stars 1.6k forks source link

Flameshot won't copy to clipboard - Still an issue #1446

Open LockeColeFF opened 3 years ago

LockeColeFF commented 3 years ago

I am aware that there are several issues that have the same problem laid out so I'll start by saying I've looked through those issues and troubleshot this to no end.

Flameshot will copy one image to the clipboard before it stops. Afterward it will not copy to clipboard anymore.

Only way to get it to work again is to restart the computer. It will work for one copy and then it will stop working.

Close after capture is disabled.

Running Ubuntu 20.10 Cinnamon

Version info: (Issue also persists on earlier versions)

Flameshot v0.9.0
Compiled with Qt 5.11.3

Config file is here"

[General]
closeAfterScreenshot=false
contrastOpacity=188
contrastUiColor=#780017
disabledTrayIcon=false
drawColor=#ff0000
drawThickness=0
saveAfterCopy=false
saveAfterCopyPath=/home/.../Pictures
savePath=/home/jordan/Pictures
savePathFixed=false
showStartupLaunchMessage=true
startupLaunch=true
uiColor=#009631

[Shortcuts]
TYPE_ARROW=A
TYPE_CIRCLE=C
TYPE_CIRCLECOUNT=
TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return
TYPE_COPY=Ctrl+C
TYPE_DRAWER=D
TYPE_EXIT=Ctrl+Q
TYPE_IMAGEUPLOADER=Return
TYPE_MARKER=M
TYPE_MOVESELECTION=Ctrl+M
TYPE_MOVE_DOWN=Down
TYPE_MOVE_LEFT=Left
TYPE_MOVE_RIGHT=Right
TYPE_MOVE_UP=Up
TYPE_OPEN_APP=Ctrl+O
TYPE_PENCIL=P
TYPE_PIN=
TYPE_PIXELATE=B
TYPE_RECTANGLE=R
TYPE_REDO=Ctrl+Shift+Z
TYPE_RESIZE_DOWN=Shift+Down
TYPE_RESIZE_LEFT=Shift+Left
TYPE_RESIZE_RIGHT=Shift+Right
TYPE_RESIZE_UP=Shift+Up
TYPE_SAVE=Ctrl+S
TYPE_SELECTION=S
TYPE_SELECTIONINDICATOR=
TYPE_SELECT_ALL=Ctrl+A
TYPE_TEXT=T
TYPE_TOGGLE_PANEL=Space
TYPE_UNDO=Ctrl+Z
mmahmoudian commented 3 years ago

I'm curious to know if killing Flameshot process (pkill flameshot) would work instead of rebooting your computer. Would you please try that and update us here.

LockeColeFF commented 3 years ago

Killing and restarting Flameshot with pkill does not fix the issue.

mmahmoudian commented 3 years ago

After Flameshot copied the first image and stops working, does your clipboard works as usual? I mean can you copy and paste other stuff?

LockeColeFF commented 3 years ago

I can copy Text and images just fine after it fails. I just tested it. Flameshot works once, then it doesn't. I installed CopyQ to troubleshoot after noticing this behavior. It confirmed what I have been experiencing. Is there a log in Flameshot that says what it's attempting to do? And is ther a log in Cinnamon that says what's writing to the clipboard?

mmahmoudian commented 3 years ago

@LockeColeFF when you run Flameshot from terminal, you can see some of the errors. Try this:

# this will kill Flameshot if it is already open
pkill flameshot

# now run Flameshot 
flameshot gui
LockeColeFF commented 3 years ago

I did what you said and the terminal doesn't display any errors. But it's still not working.

$ pkill flameshot

$ flameshot gui
# The GUI was launched.  Took screenshot.  Notification of success coming from the tray.  Checked clipboard.  Nothing there.

There's no verbose option that I could see for Flameshot either.

Arguments:
  gui            Start a manual capture in GUI mode.
  screen         Capture a single screen.
  full           Capture the entire desktop.
  launcher       Open the capture launcher.
  config         Configure flameshot.
# would be nice to have a verbose option here to see what's hapening.
mmahmoudian commented 3 years ago

@borgmanJeremy do you have any insight about how to get more verbosity?

LockeColeFF commented 3 years ago

Turns out it might not be the fault of Flameshot. I'm having strange clipboard behaviors. It seems to only want to copy file contents, text, and paths from the Desktop. Direct copies of images (Like an avatar from Github) work just fine.

I can't copy-paste files from one folder to the next using Nautilis. Flameshot may be collateral damage from this main issue.

mmahmoudian commented 3 years ago

This is interesting. This would then get a bit off-topic, but may I suggest trying another DE (e.g KDE, Gnome, or Xfce). This might be cinnamon specific issue. Also I wonder what CopyQ would show in those times that you have problems.

dmayle commented 3 years ago

@mmahmoudian if you run the command: lsof -p $(pgrep flameshot) | grep log It will show you the name of any open log files for flameshot.

mmahmoudian commented 3 years ago

@dmayle nice, I wasn't aware of lsof, cool and handy tool 👍🏼

At least for me there are 248 files listed for Flameshot none of which contain the log regardless of the case (grep -i)

dmayle commented 3 years ago

@mmahmoudian you want to look at files of type REG, and with a numbered file descriptor (not 'mem'). In my case, fd 2w is opened to .local/share/sddm/wayland-session.log.

jej commented 3 years ago

For me, clipboard feature does not work if flameshot is configured to "Quit after capture". If I uncheck this in the pref pane, it works again. (ubuntu 20.10)

mmahmoudian commented 3 years ago

@jej The "Quit after capture" has been removed form Flameshot some versions ago. I suggest you to update the Flameshot. Considering that your distro provides an older version of Flameshot I suggest you to install Flameshot through Flatpak, Snap or even use the AppImage, so that you get the most updated version that usually comes with many bug fixes and some new features.

jej commented 3 years ago

@mmahmoudian Ok thanks for the advice. I will give a try. Regards.

jej commented 3 years ago

@mmahmoudian The .deb is the right solution for me and works well. Thx

4n0nct commented 3 years ago

Not here, the problem is still present, there is a notification that shows "copied to clipboard", but it's not true, there's nothing in the clipboard, and ctrl+v won't work. What's weird is that the notification appears like it has succeed. Kde plasma if you want to know. I can save files without problem, everything works, but the copy to clipboard no, ctrl+c does the same thing, notification appears, but in fact nothing has been copied. Edit 1 : got something working: 1/ uncheck jpg to clipboard in the config gui 2/ it still didn't work while the processus still existing: killall flameshot 3/ restart flameshot, it reappears in the tray, ok. 4/ ctrl+v now works BUT the image still doesn't appears in the clipboard (see EDIT2) I can now copy paste, but if I copy something else after that then I can't go back and select the image since it's not there. EDIT 2 : Kde plasma has that disabled by default, the clipboard has "ignore images" checked It works. But it won't if jpg format, if jpg the only way to paste the image somewhere is to go select it in the clipboard, png doesn't requires that action and can directly be ctrl+v.

TLDR: Maybe it will help someone. It's better to kill flameshot and restart it if you change the format image to clipboard option, png works, jpg maybe not. Check if your clipboard accepts images by default, I had nothing to do in xfce, it worked, but kde plasma required me to go uncheck a "ignore images" parameter in the clipboard options.

HereThereBeMonsters commented 2 years ago

I have the same issue. Ubuntu MATE 21.10 Flameshot v11.0.0 () Compiled with Qt 5.12.8 Installed using .deb from GitHub release page.

Screenshots don;t get copied to the clipboard. CTRL+V pastes what was previously in the clipboard (e.g. some text)

Console output:

~ > flameshot gui                                                                            
(flameshot:140319): dbind-WARNING **: 12:38:16.567: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

However if I run it with root privilege it works, the error is gone (not sure if that is the root cause though):

~ > sudo flameshot gui
[sudo] password for henry: 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'

As root, it works, but pasting the image takes a long time, like 15 seconds.

Edit: as root it sometimes works, but not all the time :'(

mmahmoudian commented 2 years ago

@4n0nct then it is duplicate of #1738 :

https://github.com/flameshot-org/flameshot/issues/1738#issuecomment-907607629

Tuzi07 commented 2 years ago

As @4n0nct said, it does not word on KDE if you check jpg to clipboard in the config gui

fix777 commented 2 years ago

Same here on eOS 6.1 Here is the log:

$ pkill flameshot
$ flameshot gui
Qt: Session management error: None of the authentication protocols specified are supported
QApplication: invalid style override 'adwaita' passed, ignoring it.
    Available styles: Breeze, Windows, Fusion
razvanps commented 2 years ago

For those still scrolling down looking for a solution:

export -n SESSION_MANAGER

This worked for me.

My release is

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:    20.04
Codename:   focal
Nibenyi commented 2 years ago

for me, this was happening because the daemon wasn't running. Add "flameshot &" to the file who launches programs in ur system, like ~/.xnitrc or ~/.config/bspwm/bspwmrc, or you can just run it on a terminal

kinbaywu commented 2 years ago

I have the same issue. My solution is to do the Configuration>General>Reset I'm guessing it might be because I enable the "Close after capture"

Frehley commented 1 year ago

For those still scrolling down looking for a solution:

export -n SESSION_MANAGER

This worked for me.

My release is

Distributor ID:   Ubuntu
Description:  Ubuntu 20.04.5 LTS
Release:  20.04
Codename: focal

This worked for me also. Thanks!

robotfpv commented 1 year ago

for me, this was happening because the daemon wasn't running. Add "flameshot &" to the file who launches programs in ur system, like ~/.xnitrc or ~/.config/bspwm/bspwmrc, or you can just run it on a terminal

This did the trick lmao Im on fedora 37 w/ dspwm

using sxhkdrc for the hotkeys

raul-j commented 1 year ago

For me it was this checkbox, that solved it image

Ten0 commented 1 year ago

It doesn't work if there's no background tray process running. Specifically, as soon as you close the background process, the screenshot is lost. This means that if you:

Interestingly enough, when making a capture with the background process running, it's the background process that will show flameshot: info: Capture saved to clipboard.

I don't like to have to leave a process always running in the background just because I need to take screenshots sometimes. However I'd also like to be able to take screenshots to clipboard. JPG format workaround doesn't work for me.

jabedzaman commented 1 year ago

Installing xsel and after that editing the .xinitrc to start the flamshot daemon at start solved the issue

nd3w commented 11 months ago

It doesn't work if there's no background tray process running. Specifically, as soon as you close the background process, the screenshot is lost. This means that if you:

  • Open background process
  • Open flameshot gui and Ctrl+C a screenshot
  • Close background process
  • Attempt to paste That won't work, however if you attempt to paste without closing the background process this will work.

Interestingly enough, when making a capture with the background process running, it's the background process that will show flameshot: info: Capture saved to clipboard.

I don't like to have to leave a process always running in the background just because I need to take screenshots sometimes. However I'd also like to be able to take screenshots to clipboard. JPG format workaround doesn't work for me.

I confirmed this solution. Unchecked 'Use JPG format ... ' is the solution.

Insprill commented 11 months ago

I was having the same issue on Windows 11, and unchecking the "Use JPG format" also fixed the issue for me.

SegoCode commented 2 weeks ago

I was having the same issue on Windows 11, and unchecking the "Use JPG format" also fixed the issue for me.

It works!

Windows 11 24H2, some applications wouldn’t paste images correctly, while others worked as expected. Disabling the "Use JPG format" option resolved the issue entirely, allowing all applications to handle image pasting.