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

Unable to capture screen started using first launch of flameshot gui command on Sway #1673

Closed
ritikrajdev opened this issue Jun 19, 2021 · 11 comments · Fixed by #2003
Closed
Labels
Linux Linux specific issue Unconfirmed Bug The bug is not confirmed by anyone else.

Comments

@ritikrajdev
Copy link

ritikrajdev commented Jun 19, 2021

Flameshot version
v0.10.0
r1355.35a6d430-1

Describe the bug
on starting flameshot with flameshot command it works normally as it should do, but when used flameshot gui (Flameshot shouldn't be running already), it doesn't work and says unable to capture the screen + there's no icon of flameshot in the system tray.

Here's the preview of the issue mentioned (tested on my Arch Linux - 5.12.11-zen1-1-zen, Sway).

output.mp4

To Reproduce

  1. Use sway, waybar(to check system tray icon not showing)
  2. export QT_QPA_PLATFORM=wayland
  3. now just start flameshot using just flameshot command
  4. try to capture screenshot using flameshot gui, it'll work now !
  5. end the process after checking that it works (ctrl + C)
  6. pkill flameshot just for surety that no instance of flameshot is running
  7. now start flameshot with flameshot gui command and try to capture screenshot.

Expected behavior
I Expected to work it on starting even with flameshot gui + it doesn't look good having no icon in system tray of waybar when started with flameshot command only.

System Information
Arch Linux - 5.12.11-zen1-1-zen, Sway

@ritikrajdev ritikrajdev changed the title Unable to capture screen started using flameshot gui command on Sway Unable to capture screen started using first launch of flameshot gui command on Sway Jun 19, 2021
@mmahmoudian
Copy link
Member

I realized that the icon shows properly when you run flameshot gui but you see no icon when you run flameshot.

What happens when you do another flameshot gui for the second time without killing the first one?

@mmahmoudian mmahmoudian added Linux Linux specific issue Unconfirmed Bug The bug is not confirmed by anyone else. labels Jun 19, 2021
@ritikrajdev
Copy link
Author

I realized that the icon shows properly when you run flameshot gui but you see no icon when you run flameshot.

What happens when you do another flameshot gui for the second time without killing the first one?

When i do flameshot gui for second time it takes screenshot only if the process was initiated using flameshot command.

The icon above remains unaffected in each case, means no icon if started using flameshot, flameshot icon if started using flameshot gui.

@mmahmoudian
Copy link
Member

What I meant was to do something like this:

pkill flameshot; sleep 1s; flameshot gui; sleep 3s; flameshot gui

@ritikrajdev
Copy link
Author

What I meant was to do something like this:

pkill flameshot; sleep 1s; flameshot gui; sleep 3s; flameshot gui

sorry for late reply was just checking the thing again
As expected, it sent the notification stating Unable to capture screen two times.

@uncomfyhalomacro
Copy link
Contributor

idk if this is relevant but when this happens, I usually just compile flameshot from source with qt-wayland-devel and weirdly enough that fixes it.

@mmahmoudian
Copy link
Member

@ReneganRonin I don't see such package in the Arch repositorIes or AUR. What is your OS and what is your qt-wayland version?

@uncomfyhalomacro
Copy link
Contributor

uncomfyhalomacro commented Jun 19, 2021

@mmahmoudian it is actually the qt5-wayland-devel package from Void Linux (which I am currently using). When I install flameshot from the xbps package manager, said issue happens. I just compile from source after that and it works.

@uncomfyhalomacro
Copy link
Contributor

uncomfyhalomacro commented Jun 19, 2021

@ritikrajdev btw, try adding XDG_CURRENT_DESKTOP=sway when starting flameshot. I also do that when I am on river by tricking flameshot that it is on sway, otherwise it will not start correctly. Also refer #1570

@ritikrajdev
Copy link
Author

@ritikrajdev btw, try adding XDG_CURRENT_DESKTOP=sway when starting flameshot. I also do that when I am on river by tricking flameshot that it is on sway, otherwise it will not start correctly. Also refer #1570

I do that on tty before launching sway.
Hence XDG_CURRENT_DESKTOP=sway is already set universally in sway.

@ritikrajdev
Copy link
Author

I found a thing that may help in resolving i think,

it's not only happening on one single command flameshot gui
instead it is happening for each of the command flameshot screen -c, flameshot full -c. (-c is just for copying to clipboard)
if all these commands are run when there's a running instance of firefox using flameshot command only then they all work, but when flameshot is started using those commands instead, then it shows unable to capture screen.

as per my thinking, process of initialisation of flameshot daemon is different in all those sub commands as compared to the main flameshot command.

@veracioux
Copy link
Contributor

This may be resolved by #2003.

If you are impatient, you can compile the pull request already and see if it works for you. Or you can install a packaged version of the pull request from here (just find your preferred package and click "Artifacts" in the top right corner).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Linux specific issue Unconfirmed Bug The bug is not confirmed by anyone else.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants