You are not logged in.
Hello guys,
I have two different X sessions launched with startx in different TTY. Everything works, I used xdotool in order to automate some mouse/keyboard actions and it works even when the X session is not "focused".
My problem is that when I try to take a screenshot (using the command DISPLAY=:1 maim /tmp/image.png) what I get is an image of the latest time I used that X session. It seems that X doesn't update the framebuffer when it is not focused.
I don't know if I explained well, either way my question is: is there a way to keep update the X session even if it is not focused?
I saw the wiki article "Xorg multiseat" (so I think in some way this is possible) but I don't need to have different monitors and input devices.
Every advice is welcome, thank you.
If can help, here is my configuration:
Desktop computer
Arch Linux x64 updated today
NVIDIA GTX 760 (nvidia-lts driver)
linux-lts kernel
i3 window manager
here is my monitor conf (/etc/X11/xorg.conf.d) : https://ptpb.pw/NcOy
Offline
My problem is that when I try to take a screenshot (using the command DISPLAY=:1 maim /tmp/image.png) what I get is an image of the latest time I used that X session. It seems that X doesn't update the framebuffer when it is not focused.
Correct, it does not. That visual information does not exist anywhere so it cannot be retrieved. It is more than Xorg not updating the framebuffer, Xorg doesn't even seek updates from clients (in most cases).
It is the same problem you will have if you use a function like XGetImage or similar to get the contents of a window: if the winow is in the foreground, you get just what you expect. But if the window you target is obscurred (even partially) by another window, you may not get what you expect.
Your luck would be much better with Wayland as that requires compositing. There are various compositing extensions for X, though I don't know if any of them would allow for precisely what you are trying to do. Scrot/maim queries X directly, you might need a screenshot tool that instead queries the compositor.
Last edited by Trilby (2017-12-24 12:50:17)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline