Bug 2009460 - gnome-screenshot shows critical errors and does not work correctly when run from console
Summary: gnome-screenshot shows critical errors and does not work correctly when run f...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-screenshot
Version: 35
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: RejectedBlocker
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-30 17:22 UTC by Jonathan S.
Modified: 2022-11-30 18:24 UTC (History)
19 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-11-30 18:24:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME gnome-screenshot issues 179 0 None None None 2021-10-13 18:27:27 UTC

Description Jonathan S. 2021-09-30 17:22:30 UTC
Description of problem:
gnome-screenshot broke on GNOME 41. Given that taking screenshots need the compositor, this makes it currently impossible to take screenshots on GNOME 41 on Fedora 35 Beta.

Version-Release number of selected component (if applicable):
Despite being on Fedora 35 Beta, gnome-screenshot --version reports 40.0. This might be the issue.

How reproducible:
Try running gnome-screenshot

Steps to Reproduce:
1. Run gnome-screenshot -a
2. Watch it print a warning instead of taking a screenshot

Actual results:
** Message: 19:15:42.161: Unable to select area using GNOME Shell's builtin screenshot interface, resorting to fallback X11.

Expected results:
The cursor changes so that I can select an area, resulting in a picture in the Pictures directory.

Additional info:
None of the screenshot modes work, it's not limited to -a.

Comment 1 Jeremy Borgman 2021-10-07 02:02:06 UTC
I am the maintainer of flameshot and was testing flameshot on Fedora35 and it also does not work. We use dbus under the hood to call the native gnome screenshot tool. I took it one step further and manually called the gnome dbus API and that seems to be the root cause: 

Steps to reproduce:
Call this from the CLI

dbus-send --session --print-reply --dest=org.gnome.Shell /org/gnome/Shell/Screenshot org.gnome.Shell.Screenshot.Screenshot boolean:false boolean:false string:'/tmp/test.png'


Actual Result:
Error org.freedesktop.DBus.Error.AccessDenied: Screenshot is not allowed


Expected Result:
Saves screenshot to /tmp (or in my case returns to flameshot)

Comment 2 Jonathan S. 2021-10-08 12:28:39 UTC
In that case, the problem doesn't seem to be gnome-screenshot, but actually gnome-shell. Moving this to the gnome-shell component.

Comment 3 Fedora Blocker Bugs Application 2021-10-08 15:20:06 UTC
Proposed as a Blocker for 35-final by Fedora user js using the blocker tracking app because:

 Being unable to take a screenshot in any way breaks core functionality users expect to work. There also does not appear to be any workaround.

Comment 4 Adam Williamson 2021-10-08 17:53:19 UTC
Using print screen and running Screenshot from the overview both work fine for me. I can't launch 'gnome-screenshot' from a console at all, but that's not the usual way of running it.

I can also reproduce the dbus error and I see that this may break flameshot, but that just seems like something to figure out between flameshot and gnome-shell and wherever this dbus policy is being set.

Comment 5 Jeremy Borgman 2021-10-08 20:26:33 UTC
Do you have any tips on figuring out where the dbus policy is set?

Comment 6 Adam Williamson 2021-10-08 20:36:57 UTC
sorry, not off the top of my head. The GNOME devs may know more. You may want to report this upstream (gitlab.gnome.org) as issues there often get more attention than here.

Comment 7 Jonathan S. 2021-10-09 12:11:49 UTC
Pressing Print does nothing for me either. Starting GNOME Screenshot from the overview indeed works, though. But not from the command line.

Comment 8 Jonathan S. 2021-10-09 12:14:24 UTC
And I just noticed: I looked at what the .desktop file does, and it just launches gnome-screenshot -w. Running that from the command line doesn't work either.

Some difference in environment?

Comment 9 Jonathan S. 2021-10-09 12:18:04 UTC
Some more debugging: Running `gnome-screenshot -a` when bound to a key in GNOME doesn't work either. Binding that key to `gtk-launch org.gnome.Screenshot`, it opens the screenshot tool - but then obviously needs extra clicks to actually take a screenshot.

Comment 10 Michael Catanzaro 2021-10-09 18:51:03 UTC
Seems gnome-screenshot only works when launched via D-Bus activation or when using 'gnome-screenshot -i'. Otherwise, it is pretty busted.

(In reply to js-fedora from comment #7)
> Pressing Print does nothing for me either. Starting GNOME Screenshot from
> the overview indeed works, though. But not from the command line.

PrtScn works perfectly fine for me.

(In reply to js-fedora from comment #8)
> And I just noticed: I looked at what the .desktop file does, and it just
> launches gnome-screenshot -w. Running that from the command line doesn't
> work either.

You must be looking at one of the actions. It really uses 'gnome-screenshot --interactive', which is not broken. But even that gets ignored, because it uses DBusActivatable=true.

Comment 11 Jonathan S. 2021-10-10 20:29:27 UTC
You're right, I looked wrong, using `gnome-screenshot --interactive` works indeed. Please disregard.

Comment 12 Lukas Ruzicka 2021-10-11 07:49:15 UTC
Hello,
running the latest version of Gnome-Shell, i.e. gnome-shell-41.0-3.fc35.x86_64, I am seeing the following:

* The Print Screen button works for me and creates a screenshot of the entire desktop.
* The `gnome-screenshot --interactive` command works commpletely.
* The combo `Ctrl-Shift-PrtSc' that would normally allow for area selection DOES NOT WORK. It produces the cross cursor, but when the screenshot is taken, nothing is saved in the Pictures folder.
* The `gnome-screenshot -a` command produces warnings (see below) but the screenshot is taken and saved.


** Message: 09:42:17.833: Unable to select area using GNOME Shell's builtin screenshot interface, resorting to fallback X11.
** Message: 09:42:21.664: Unable to use GNOME Shell's builtin screenshot interface, resorting to fallback X11.

Comment 13 Kamil Páral 2021-10-11 14:19:12 UTC
(In reply to Lukas Ruzicka from comment #12)
> * The combo `Ctrl-Shift-PrtSc' that would normally allow for area selection
> DOES NOT WORK. It produces the cross cursor, but when the screenshot is

That's because that shortcut saves the picture into the clipboard (you can paste it e.g. in GIMP). Shift+PrintScreen saves it as a file. Both work for me. You can see all the shortcuts in the gnome-control-center.

Comment 14 Lukas Ruzicka 2021-10-11 16:17:17 UTC
> (In reply to Lukas Ruzicka from comment #12)
> > * The combo `Ctrl-Shift-PrtSc' that would normally allow for area selection
> > DOES NOT WORK. It produces the cross cursor, but when the screenshot is
> 
> That's because that shortcut saves the picture into the clipboard (you can
> paste it e.g. in GIMP). Shift+PrintScreen saves it as a file. Both work for
> me. You can see all the shortcuts in the gnome-control-center.

Gosh, I did not realize that. Sorry about that.(In reply to Kamil Páral from comment #13)

Comment 15 Geoffrey Marr 2021-10-11 18:56:32 UTC
Discussed during the 2021-10-11 blocker review meeting: [0]

The decision to classify this bug as a "RejectedBlocker (Final)" was made as multiple testers found no bugs in basic functionality here, screenshot taking works as intended via shortcuts and in the app launched from the overview.

[0] https://meetbot.fedoraproject.org/fedora-blocker-review/2021-10-11/f35-blocker-review.2021-10-11-16.00.txt

Comment 16 Michael Catanzaro 2021-10-12 14:21:13 UTC
Likely somehow related to: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970

Comment 17 Adam Williamson 2021-10-12 18:36:10 UTC
what's left here that would actually be considered a bug, for clarity? not being able to run the app successfully from a console?

Comment 18 Michael Catanzaro 2021-10-12 18:56:58 UTC
(In reply to Adam Williamson from comment #17)
> what's left here that would actually be considered a bug, for clarity? not
> being able to run the app successfully from a console?

That, plus the spew of criticals, yes. In GLib applications, CRITICAL indicates programmer error and undefined behavior, so it should never happen. Here's what I see when I run gnome-screenshot currently:

$ gnome-screenshot
** Message: 13:56:02.386: Unable to use GNOME Shell's builtin screenshot interface, resorting to fallback X11.

(gnome-screenshot:79948): Gdk-CRITICAL **: 13:56:02.386: gdk_pixbuf_get_from_surface: assertion 'width > 0 && height > 0' failed

(gnome-screenshot:79948): GdkPixbuf-CRITICAL **: 13:56:02.386: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(gnome-screenshot:79948): GdkPixbuf-CRITICAL **: 13:56:02.386: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug


(gnome-screenshot:79948): GdkPixbuf-CRITICAL **: 13:56:02.386: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(gnome-screenshot:79948): GdkPixbuf-CRITICAL **: 13:56:02.386: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(gnome-screenshot:79948): Gtk-CRITICAL **: 13:56:02.399: gtk_window_resize: assertion 'width > 0' failed

** (gnome-screenshot:79948): CRITICAL **: 13:56:02.399: Unable to capture a screenshot of any window

Comment 19 Jonathan S. 2021-10-12 19:38:50 UTC
I had a shortcut to take a screenshot of an area in gnome-shell, that still doesn't work. This was executing `gnome-screenshot -a`.

Comment 20 Adam Williamson 2021-10-12 19:50:06 UTC
As noted above, there is a built-in shortcut for that - shift-prtsc to save an area screenshot as a file, ctrl-shift-prtsc to copy one to the clipboard.

Comment 21 Jonathan S. 2021-10-12 19:54:36 UTC
Ah, Print was my compose key, therefore it didn't work. I now found the Shift-Print shortuct in settings and changed it to a different key and that seems to work.

Comment 22 Daniel Blittschau 2021-11-09 01:16:37 UTC
I am also experiencing this issue on Fedora 35 release.

I have my PrtScr key bound to a script that runs `gnome-screenshot` to save screenshots to a non-standard location (i.e. $HOME/Pictures/Screenshots) and a custom naming format.

Currently this completely breaks my workflow so I would appreciate any attention given to this bug.

Comment 23 Jonathan S. 2022-08-20 18:43:00 UTC
Since the screenshot feature has been entirely revamped in GNOME, I'm not sure if this is relevant any longer. From my side, this can be closed.

Comment 24 Ben Cotton 2022-11-29 17:06:18 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 25 Adam Williamson 2022-11-30 18:24:26 UTC
So a fix for this was merged upstream: https://gitlab.gnome.org/GNOME/gnome-screenshot/-/commit/97316afbd1e9b0c25de5f87b52d47448ee667bdb

that was in 41.0, and that version did make F35:
https://bodhi.fedoraproject.org/updates/FEDORA-2021-a15c545dc5

I just tested here on F37 and gnome-screenshot runs OK from a console with no criticals, and saves a screenshot. The F37 build is 41.0-4, but -2, -3 were just rebuilds and -4 was a build fix for a newer meson, so I'm pretty sure this should be OK on F35 now too. So, marking as fixed.


Note You need to log in before you can comment on or make changes to this bug.