Open danstewart opened 2 years ago
2691 + 397 = 3088 < 3840
299 + 795 = 1094 > 1080 (this is the reason)
I think xwininfo
calculate window shadow as part of select area
Looks like it, do you maybe need to remove the depth
value?
xwininfo
output for another failing example:
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x7001c18 "Area Chooser"
Absolute upper-left X: 2341
Absolute upper-left Y: 297
Relative upper-left X: 2341
Relative upper-left Y: 297
Width: 1163
Height: 801
Depth: 32
Visual: 0x6ab
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x7000006 (not installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +2341+297 -336+297 -336--18 +2341--18
-geometry 1163x801+2341--18
Error:
[x11grab @ 0x559d8f036a00] Capture area 1163x801 at position 2313.301 outside the screen size 3840x1080
:99.0+2313,301: Invalid argument
297 + 801 = 1098 1098 - 32 = 1066
1066 seems like the correct Y position of the window.
I don't know if depth is used for that?
I can't find a definitive answer of what the depth
value actually means.
Found a few forum posts using at as color depth but I don't think that's correct.
Testing on a few different windows I tend to get either 24 or 32. Seems GTK apps are 32 and electron apps are 32.
It does seem to be roughly correct, I put the area chooser at the bottom of the screen.
xwininfo:
Absolute upper-left X: 2270
Absolute upper-left Y: 810
Relative upper-left X: 2270
Relative upper-left Y: 810
Width: 397
Height: 299
Depth: 32
Error:
[x11grab @ 0x55bcd20f1a00] Capture area 397x299 at position 2270.810 outside the screen size 3840x1080
299 + 810 = 1109 1109 - 32 = 1077
So there are 3px unaccounted for :man_shrugging:
After some further testing maybe this isn't what is needed.
Some tests with a window aligned to the bottom of the screen:
Having an issue with the "Area Chooser". When it's near the bottom of the screen I get an error complaining the area is off the screen.
Here is the exact error:
And here is a screenshot of the captured area:![image](https://user-images.githubusercontent.com/10670565/153453103-d9a5df92-872d-45f9-9fd8-4ff8b1853d09.png)