shutter-project / shutter

Screenshot tool for Linux
https://shutter-project.org/
GNU General Public License v3.0
539 stars 35 forks source link

Screenshots its own countdown info notification #330

Open Moonbase59 opened 3 years ago

Moonbase59 commented 3 years ago

Brief summary of issue

Shutter screenshots its own countdown notification window. It should wait until the notification is gone (or remove it before activating).

Schreiben - Obsidian v0 12 3_033

Steps to reproduce the issue

  1. Set a 5s delay.
  2. Move window to be screenshot to where the notification appears.
  3. Make a screenshot of the window.

Error output

None.

Extra information, such as Shutter version, operating system and ideas for how to solve:

Shutter 0.94.3 Rev.1306 on Linux Mint 20.1/Cinnamon. Installed from this PPA: deb http://ppa.launchpad.net/linuxuprising/shutter/ubuntu focal main since no other version found and no wish to compile.

Photon89 commented 3 years ago

Possibly this is not an issue in 0.96 any more. Also, possibly there is a long duration set in CInnamon's settings for the notification bubble's closing animation?

vadi2 commented 3 years ago

afaik this is shutters own animation, not cinnamon's

Photon89 commented 3 years ago

I think, this is a standard libnotify notification initiated by Shutter, but the window manager takes care of animating the appearance and disappearance of such notification bubbles.

vadi2 commented 3 years ago

I don't think that is the case - Mario implemented an own notification system into Shutter for the very reason that libnotify doesn't give control over the notification expiration time. Mind double-checking?

Photon89 commented 3 years ago

Ah, thanks for pointing that out, my bad! So libnotify isn't involved, but I still think that the window manager (Cinnamon's window manager in this case) has control over animations which are shown when a notification, or any other window, is shown and hidden. If I set the closing animation's duration to 10s in my window manager settings, Shutter will capture it, even if the notification itself has the correct duration which was set by Shutter.

Moonbase59 commented 3 years ago

Yep, this somehow looks like you control it (for the seconds countdown which are exact) but the window manager lets it stay too long. I wonder if you can tell it to "stop" or just update the content?

N.B.: It seems "normal" Cinnamon notifications are in the top right corner of the screen, but Shutter’s are in the lower right. Don’t know if that has anything to do with it.

Photon89 commented 3 years ago

Maybe we can try to prove or disprove this hypothesis by switching the Cinnamon effects off temporarily?

Moonbase59 commented 3 years ago

Good idea, how would I do that?

Moonbase59 commented 3 years ago

I spelunkered a bit. Seems Cinnamon has hardcoded 4s timeout in /usr/share/cinnamon/js/ui/messageTray.js:

matthias@e6510: ~_037

Then again, I managed to screenshot a situation where a Cinnamon notification arrived (top right) plus Shutter screenshot its own last second countdown (bottom right). So I suspect it doesn’t use the "normal" notifier?

Workspace 1_040

Photon89 commented 3 years ago

No it doesn't indeed (sorry for the confusion), but Cinnamon still controls the animation duration. You can switch off the animations completely, if the animation duration is hard do change: https://www.technipages.com/linux-mint-how-to-disable-minor-animations-for-improved-performance

Moonbase59 commented 3 years ago

Okay, thanks for the heads-up! Disabled all effects but that didn’t change anything. Still the "1 second" notification on the screenshot.

Moonbase59 commented 3 years ago

I found that I can actually select which notification manager to use: Built-in (was selected) or the "Desktop notifications" ("Schreibtischbenachrichtigungen"—isn’t German an awful language? :grin:):

Shutter - Einstellungen_045

No problems using the "Desktop notifications", not even when the window to screenshot is beneath it. So we can rule out Cinnamon, I reckon …

Would be nice if the built-in also worked, but if everyone is concentrating on making GTK3 work and there will be a PPA, I could as well wait. Don’t want to block anyone from doing the important work!

Photon89 commented 3 years ago

That's weird, as vadi2 wrote, the built in notification are actually a hack to prevent such a problem with the desktop notifications, not the other way around... I am wondering how things behave if you use a very short (1s) or very long (10s) delay. Will still the builtin notification be caught at 1s and the desktop notification function without problem?

Moonbase59 commented 3 years ago

Here are the results from about 10 tests per variant:

Delay Desktop notifier shot Internal notifier shot
1s
5s X
10s X

For these tests I screenshot a half-width application window on a 1920x1080 screen, right side, that would be overlapped by both the desktop notifier (top right) and Shutter’s notifier (bottom right). But of course I was lazy and just used the "repeat last screenshot" function.

Moonbase59 commented 3 years ago

Now that Linuxuprising had a new version in the PPA (0.98 rev 1570), I tried again: Still the same

Workspace 1_162

Photon89 commented 3 years ago

I just tried to reproduce it in VM and couldn't... Mint 20.2 Cinnamon, Shutter 0.98. Possibly a video card/driver issue on your end?

Moonbase59 commented 3 years ago

If I’d know that … No problems whatsoever with any other software, though. But yes, the Linux Mint 20.2/Cinnamon is a Dell laptop and has nVidia graphics built-in.

I do a lot of screenshots, for instructional and debugging purposes, and having to move the application "away" or almost always getting the notification in the image on full-screens drives me nuts.

But for screenshots Shutter is just "it"—wouldn’t want anything else (and there isn’t, with this functionality).

Photon89 commented 3 years ago

I do a lot of screenshots, for instructional and debugging purposes, and having to move the application "away" or almost always getting the notification in the image on full-screens drives me nuts.

Oh, I thought, switching to desktop notification was a working workaround? In worst case you can just disable the notifications completely!

Moonbase59 commented 3 years ago

In worst case you can just disable the notifications completely!

Sure, but I usually watch the (mostly 5s) timer to set up things appropriately (open menus, point to things with the mouse, etc.).

Photon89 commented 3 years ago

I see. So what about using the desktop notification for the time being?

Moonbase59 commented 3 years ago

Knowledgebase - Obsidian_003

Same thing here :-(

Moonbase59 commented 3 years ago

Sorry mis-clicked.

Photon89 commented 3 years ago

Oh, that's weird, but in https://github.com/shutter-project/shutter/issues/330#issuecomment-847760578 you wrote that the desktop notifications don't get caught?

If you screenshot a video, can you tell from the timestamp if the screenshot is actually showing the state of the screen at the time it should, or if it lags behind one second?

Moonbase59 commented 3 years ago

Oh, that's weird, but in #330 (comment) you wrote that the desktop notifications don't get caught?

That’s true, but as I said,

Now that Linuxuprising had a new version in the PPA (0.98 rev 1570), I tried again: Still the same

So now I got for testing:

The latest tests were made on 0.98 rev 1570 (since and including https://github.com/shutter-project/shutter/issues/330#issuecomment-894507347).

Re screen video: I’ll try to set something up the next days that includes a clock with seconds.

Moonbase59 commented 3 years ago

Today an update came (0.98-1~1ppa1~focal0, still displays as 0.98 rev 1570), so I tested again.

If you screenshot a video, can you tell from the timestamp if the screenshot is actually showing the state of the screen at the time it should, or if it lags behind one second?

With the 5-second-delay, that’s actually more difficult than I thought. I always have the feeling that, after starting, about a second nothing happens, then the 5s countdown, then about 1s with no notification onscreen and the "feeling" it will now shoot the screen, then the "saved" notification.

So the overall feeling is that when clicking like "repeat last screenshot", it takes 6 instead of 5 seconds, and for the clock, I was always a second too late.

Studio Krumbach (studiodisplay1) - Mozilla Firefox_001

I clicked "repeat last screenshot" exactly when the clock showed 5s before the minute.

Since this screenshot went without the notification shown, I was hopeful and tested some other applications, by moving their window to the right side of the screen:

* = based on Electron

My first impression was: "What! It happens only with Electron apps?!" because it really looked like so. Almost every Atom or Obsidian screenshot had the notification, while others like Geany or Nemo seemingly not. But that was jumping to conclusions … The other programs still show the notification in the image, it just happens not so often.

Photon89 commented 3 years ago

That's weird, if it shoots too late, the notification should be gone more than ever...

I have a possibly related problem on my new laptop with an Intel Iris Xe video chip. If I use Compiz, Shutter will catch an outdated screen state (can be several minutes old). But at least in my case the problem is not Shutter specific but happens with the Xfce screenshot tool as well. Also, the problem disappears if I switch from Compiz to Xfwm.