Bug 359554 - Wrong screen region captured when capturing a window on i3
Summary: Wrong screen region captured when capturing a window on i3
Status: RESOLVED INTENTIONAL
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-18 20:53 UTC by nicolas.mr
Modified: 2016-04-25 21:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicolas.mr 2016-02-18 20:53:58 UTC
I'm using spectacle with the i3 window manager, and in some circumstances the region captured is incorrect. It's possible that this problem stems from i3 not setting properly the window properties. However I don't remember having this issue with KSnapshot, and other snapshot tools with similar functionalities produce the expected result.

Reproducible: Always

Steps to Reproduce:
1. Use i3wm
2. Set a window floating (away from the top left corner of the screen), or in an vertical split, not on the left hand side of the screen.
3. Start spectacle and select windows under cursor
4. Take a screenshot of the floating window or a window on the right hand side of a vertical split.

Actual Results:  
Spectacles captures a region that appears to be of the right size, but instead of it being the window clicked on, it is a region starting on the top left corner of the screen.

Expected Results:  
Actually take a screenshot of the window that was clicked on.

A few examples demonstrating the issue:

First setup, trying to capture a dialog window:
- Desktop: https://i.imgur.com/oRYaX5o.png
- Screenshot obtained by clicking on the dialog window: https://i.imgur.com/1d1abEu.png

Second setup, trying to capture a window on a right hand side of a vertical split:
- Desktop: https://i.imgur.com/vtr02W6.png
- Screenshot obtained by clicking on the terminal on the right: https://i.imgur.com/UtKrnb0.png

Third setup, slightly more complicated splits:
- Desktop: https://i.imgur.com/7TkhPdB.png
- Screenshot obtained by clicking on the terminal on the bottom right: https://i.imgur.com/kCK8fjO.png

In this third case, clicking on the two other windows produces the expected result.
Comment 1 Boudhayan Gupta 2016-04-25 21:25:05 UTC
Spectacle's window hierarchy detection code is tailored to how KWin structures its window graph. I don't see how we can fix this without major changes to the X11 backend.

Do track https://bugs.kde.org/show_bug.cgi?id=357223 - that will eventually be fixed; perhaps a side effect of that will be your bug will be fixed, too.