You are not logged in.

#1 2016-10-18 13:21:26

Lesmana
Member
Registered: 2015-05-04
Posts: 18

[solved] gnome wayland: screenshot tools scrot maim import not working

(edit: solved in the sense that i know what is going on. not that it is no longer a problem)

As I understand gnome recently switched to using wayland. I did a system update yesterday. My gnome version is now 3.22.1 and in gnome settings -> details it says it using wayland.

The good news: everything seems to work fine.

The bad news: the screenshot tools scrot, maim and import no longer work.

Scrot and maim produce only black images. Import produces following error message:

$ import -window root foo
import: unable to read X window image `root': Resource temporarily unavailable @ error/xwindow.c/XImportImage/4983.
import: missing an image filename `foo' @ error/import.c/ImportImageCommand/1287.

Question to people using gnome and wayland: can you please verify the behaviour of these screenshot tools?

I am a bit paranoid because before using wayland I had another problem with the screenshot tools and it seemed to me that I was the only one in the internet with that problem. https://bbs.archlinux.org/viewtopic.php?pid=1662272

Last edited by Lesmana (2017-09-12 17:49:32)

Offline

#2 2016-10-18 13:34:00

ooo
Member
Registered: 2013-04-10
Posts: 1,637

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

You already got an explanation on your last thread.

Lone_Wolf wrote:

That has a simple explanation :gnome now runs on wayland by default, scrot and main are  designed to run in X .

scrot etc. are designed to take screenshot of your X session, and are not supposed to work on wayland.

Offline

#3 2016-10-18 13:44:35

Lesmana
Member
Registered: 2015-05-04
Posts: 18

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

Thank you for your effort. I am aware of that explanation. I asked for verification because I would like to know whether other people experience the same behaviour. I am a bit paranoid because with my last problem it seemed to me that I was the only one in the internet with that problem.

Offline

#4 2016-10-19 05:23:08

blufinney
Member
Registered: 2014-08-26
Posts: 59

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

FWIW the native screenshot function of gnome seems to work fine with the latest 3.22 and wayland.  Use PrtSc button for full screen, Shift+PrtSc to choose an area of the screen, and Ctrl+PrtSc for the current window.  I don't know what those other tools do, but hope this helps either way.

-blu

Offline

#5 2016-11-04 16:35:37

Lesmana
Member
Registered: 2015-05-04
Posts: 18

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

Offline

#6 2016-11-04 18:02:24

Lesmana
Member
Registered: 2015-05-04
Posts: 18

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

New observation: behaviour of scrot, maim and import changes with reboots. Sometimes they create screenshots. Sometimes they create black images or error messages. I just rebooted 6 times and in 2 out of 6 reboots I had black images and error messages.

I seldom reboot that is why I did not notice this earlier. Usually I reboot only after a system update. I just did a system update. I do not know whether behaviour change is because of system update.

It seems that I am the only person on the internet with this behaviour. This makes me sad sad

Offline

#7 2016-11-10 13:53:46

Lesmana
Member
Registered: 2015-05-04
Posts: 18

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

I have found an explanation for the behaviour change with reboots. It seems that my system chooses to boot gnome wayland or gnome X at random. At times it even seems to ignore what I select at the login screen. It just picks one or the other at random.

I have not found an explanation for that. Though I have not been researching thoroughly. Actually I just want to use my system and hack my scripts which take screenshots and automate stuff. I just have one system at the moment and I need this one system for daily work. I cannot experiment much for fear of breaking the system.

Offline

#8 2016-11-10 14:08:45

Lesmana
Member
Registered: 2015-05-04
Posts: 18

Re: [solved] gnome wayland: screenshot tools scrot maim import not working

At least I have a definitive explanation for why the screenshot tools do not work under wayland:

By design, Wayland is a lot more secure than X11 and does not allow one application to capture the content of other applications' windows, meanignath a X11 based screenshot tool cannot work underWayland/Xwayland.

Both Weston and gnome-shell (Wayland compositors) have screencast and screenshot features built-in.

https://bugs.freedesktop.org/show_bug.cgi?id=98672

So it's not a bug, it's a feature.

I understand the security argument. But why disable that feature only to have it enabled again by gnome (or weston)? Any malicious tool that wants to do harm by screenshoting can do it via gnome instead.

But what do I know. I am but a humble linux user trying to automate stuff by screenshoting and image recognition.

For the curious: I wanted to write aimbots for stupid flash games. Just to distract my tired mind from other tasks. Instead of writing aimbots the last months I have written shell scripts that take screenshots and awk scripts that compares them and learned about wayland and xwayland. So I got that going for me. Which is nice.

Offline

Board footer

Powered by FluxBB