neXromancers / shotgun

Minimal X screenshot utility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Taking a screenshot of a window crops out the title bar and borders on Cinnamon

areographe opened this issue · comments

Hey, this might be a dumb question, but what am I doing wrong here? If I run

shotgun -i $(xdotool getactivewindow)

I get a screenshot without the title bar and borders of the window. Is there a flag I am missing somewhere to include these in the screenshot? Thanks

1596358622

Cinnamon uses a reparenting window manager. This means the frame is a separate, parent window of the actual window. If you want to capture the decorations with the contents, you need to pass shotgun the id of the parent window. xdotool getwindowfocus is probably what you want.

Thanks, I didn't know that! Unfortunately it seems like getactivewindow and getwindowfocus both return the same window id in Cinnamon.

OK, I am going to abandon this for a while but

shotgun -i $(xwininfo -children -id $(xdotool getactivewindow) | grep "Parent" | cut -b 21-29)

does actually work, although it seems to leave a 10-pixel buffer around the edges of the window.

1596364363

commented

@areographe It might be worth trying hacksaw to get the window ID, as it has a flag to remove some number of nested window manager frames

although it seems to leave a 10-pixel buffer around the edges of the window.

Yeah I suspect this is the window manager reserving some space for a drop shadow. Maybe fixing #4 would help here.

@areographe It might be worth trying hacksaw to get the window ID, as it has a flag to remove some number of nested window manager frames

Good thinking, I've now given this a go. hacksaw grabs the parent window by default, which is good, but the as @9ary mentioned it looks like the window manager (Muffin? I think?) is leaving space for shadows etc around the edges, i.e. the same issue i mentioned before. Now I'm curious about how gnome-screenshot manages to get the decoration (title bar + borders) but not the shadow when one uses the 'current active window' option.

The window manager sets special properties on the frame window to tell other programs about this, but currently both shotgun and hacksaw ignore it.