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

Screenshot takes 2-3 seconds to make on Ubuntu #549

Open
amcsi opened this issue Feb 23, 2023 · 8 comments
Open

Screenshot takes 2-3 seconds to make on Ubuntu #549

amcsi opened this issue Feb 23, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@amcsi
Copy link

amcsi commented Feb 23, 2023

Brief summary of issue

It takes 2-3 seconds to make a screenshot with Shutter. This is a problem, because I often attempt to make a screenshot, then alt-tab to somewhere else, and then later realize that what I made a screenshot of was what I alt-tabbed into.

See lower down for a video.

Steps to reproduce the issue

  1. Run shutter --full --delay=0 -e -o ~/Pictures/Screenshot_%Y-%m-%d_%H_%M_%S.png
  2. Observe how long it takes to make the screenshot
  3. Rather than the screenshot being nearly instantaneous, it takes 2-3 seconds.

Error output

Extra information, such as Shutter version, display server in use (Xorg or Wayland), operating system and ideas for how to solve:

0.99.2 Rev.1593
Ubuntu 22.04.2 LTS
Display Server: x11

Ideas: with all this unsolicited debug information I got, perhaps the PPA leads me to some heavily unoptimized debug build of the application?

Video:
https://user-images.githubusercontent.com/116494/220852726-a08accb3-51a5-44b0-b029-b688cd238efc.mp4

File:
https://gist.github.com/amcsi/1312272217e68857314d576105ca005a

@amcsi amcsi added the bug Something isn't working label Feb 23, 2023
@vadi2
Copy link
Contributor

vadi2 commented Feb 23, 2023

What resolution are you running?

@amcsi
Copy link
Author

amcsi commented Feb 23, 2023

I have 2x 1080p monitors.

@Photon89
Copy link
Member

Shutter takes some seconds to load indeed. Also, the debug output is expected, see #338 But once Shutter has started and is sitting in the tray, taking screenshots should be fast, both from CLI and from GUI.

@amcsi
Copy link
Author

amcsi commented Feb 25, 2023

I was hoping the issue was as simple to fix as that, but I tried, and not quite.

First of all, yes I can start shutter by itself, and it brings up a window, adds itself to the try, and stays open.

Then when I run the command to make a screenshot (not using the GUI), it takes a screenshot in 1 second. Still not instantaneous, but a better than 2-3 seconds. As a reminder: the delays are bad, because I can alt-tab away from the windows I wanted to make screenshots of, taking a screenshot of the thing I alt-tabbed into instead by mistake.

Then as soon as the screenshot is made, shutter that's on the tray exists. And from then on it's back to 2-3 second screenshots.

@Photon89
Copy link
Member

Photon89 commented Feb 25, 2023

Then as soon as the screenshot is made, shutter that's on the tray exists.

That shouldn't happen. Could you please

  1. Run shutter from CLI.
  2. Run shutter -f while Shutter is sitting in the tray in a different terminal window.
  3. If Shutter exists and is not present in the tray any more, post the additional output from your shutter command in step 1 which has been shown after step 2.

@amcsi
Copy link
Author

amcsi commented Feb 25, 2023

@Photon89 shutter -f did not exist shutter. I realized that it's because it didn't have -e in the command like mine. After removing -e from my command, it also stopped existing shutter in the try.

That being said, I still saved the outputs: https://gist.github.com/amcsi/05ea58ed8e0490bf3a9ddce1cc54cfa8

So the situation is much better. Though there's still a ~1 second delay when making a screenshot from CLI even still. It would be really awesome if something could be done with that delay too.

It appears that when making a screenshot through the GUI, the delay is even less ~500ms, which is pretty good already, but I can't achieve that using the CLI which I bound to global hotkeys.

@Photon89
Copy link
Member

I think, that's because Shutter starts loading stuff when executed from CLI and only after half a second notices that an instance is already running and then connects to it. Maybe the check for an existing instance could be placed earlier in the launching routine? @DarthGandalf, any thoughts?

@DarthGandalf
Copy link
Member

Potentially this time could be decreased, but I don't know how much: CLI definitely loads too much stuff it won't use, but I can't remove some of it without breaking GUI (because of how Perl works with GLib). Likely rewriting shutter on Rust or whatever will yield more performance improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants