Open adam-nielsen opened 2 years ago
TL;DR: To be honest, I don't think there could be a nice solution for Xorg. If you know a screenshot application which doesn't have this issue, please let me know.
Long answer: there are various options to fix this, but each one is ugly.
A workaround might be to take a full screenshot and then crop it to the desired region (via ImageMagick + slop or something similar). Still has its drawbacks, like not being able to see the menu once you click, but I think it would be the simplest option.
I'm working on it right now, but there seems to be an issue in maim itself (#265)
Here's an almost working example (works with scrot, and in the same situation on wayland with grim)
{ cat ~/pipe.tmp |\
tee ~/Images/Screenshots/$(date +%F_%T).png |\
xclip -selection clipboard -t image/png
} &
maim -u | feh -F - &
background=$!
maim -s -k - > ~/pipe.tmp &
selectoin=$!
wait $selectoin
kill $background
Ofc, you need to set up named pipe yourself
- it is possible to freeze X server before taking screenshot
That sounds interesting.... Doesn't scrot use this feature for it's --freeze option?
I'll take a look, but I'm not hopeful to understand
- it is possible to freeze X server before taking screenshot
That sounds interesting.... Doesn't scrot use this feature for it's --freeze option?
It does, and if we want to have this functionality to maim, it should probably be implemented in slop.
I have tried freezing X11 server from maim before calling slop, and that actually made slop fail.
It does, and if we want to have this functionality to maim, it should probably be implemented in slop.
Actually, if someone wants to try patching maim to freeze screen before taking screenshot, I suggest trying it this way.
Maybe I will try that myself later, when I have more free time, but no guarantees!
Windows' Win+Shift+S somehow doesnt freeze anything except the image that was on the screen at the point of invoking that shortcut and then lets one capture that, isn't it possible to make some kind of overlays with max Z level on linux?
So I found out that spectacle can do that https://github.com/KDE/spectacle
except the image that was on the screen
This is exactly what we where talking about, and what scrot is using
Is there a way to use
--select
but not have windows lose focus? It appears to be impossible to take a screenshot of menus, drop-down boxes, or other UI elements that hide themselves once they lose focus.Screenshots can be taken without
--select
and these elements captured, but the image must be cropped manually afterwards. It would be great if these sorts of screenshots could also be captured when--select
is in use.I'm not sure how you'd accomplish it though, other than taking a full-screen screenshot and then having the selection box drawn over that temporary screenshot instead of the actual display.