Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
areographe opened this issue Aug 2, 2020 · 7 comments
Labels

Comments

@areographe
Copy link

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

@9ary
Copy link
Member

9ary commented Aug 2, 2020

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.

@areographe
Copy link
Author

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

@areographe
Copy link
Author

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

@expectocode
Copy link
Member

@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

@9ary
Copy link
Member

9ary commented Aug 2, 2020

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
Copy link
Author

@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.

@9ary
Copy link
Member

9ary commented Aug 2, 2020

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

@9ary 9ary added the question label Jun 27, 2022
@9ary 9ary closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants