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

Capture area ... at position ... outside the screen size 3840x1080 #28

Open
danstewart opened this issue Feb 10, 2022 · 6 comments
Open
Labels
bug Something isn't working

Comments

@danstewart
Copy link

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:

[x11grab @ 0x55a0a1c9ea00] Capture area 397x299 at position 2691.795 outside the screen size 3840x1080
:99.0+2691,795: Invalid argument

And here is a screenshot of the captured area:
image

@xlmnxp
Copy link
Owner

xlmnxp commented Feb 10, 2022

2691 + 397 = 3088 < 3840
299 + 795 = 1094 > 1080 (this is the reason)
I think xwininfo calculate window shadow as part of select area

@xlmnxp xlmnxp added the bug Something isn't working label Feb 10, 2022
@danstewart
Copy link
Author

danstewart commented Feb 11, 2022

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.

@xlmnxp
Copy link
Owner

xlmnxp commented Feb 11, 2022

I don't know if depth is used for that?

@danstewart
Copy link
Author

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.

@danstewart
Copy link
Author

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 🤷‍♂️

@danstewart
Copy link
Author

danstewart commented Feb 11, 2022

After some further testing maybe this isn't what is needed.

Some tests with a window aligned to the bottom of the screen:

Nautilus (Gnome Files)
  Absolute upper-left X:  2075
  Absolute upper-left Y:  647
  Relative upper-left X:  2075
  Relative upper-left Y:  647
  Width: 644
  Height: 495
  Depth: 32

647 + 495 = 1142
1142 - 32 = 1110

Gedit
  Absolute upper-left X:  2405
  Absolute upper-left Y:  257
  Relative upper-left X:  2405
  Relative upper-left Y:  257
  Width: 1058
  Height: 885
  Depth: 32

257 + 885 = 1142
1142 = 32 = 1110

VS Code
  Absolute upper-left X:  2722
  Absolute upper-left Y:  810
  Relative upper-left X:  10
  Relative upper-left Y:  39
  Width: 508
  Height: 270
  Depth: 24

810 + 270 = 1080

Spotify
  Absolute upper-left X:  2073
  Absolute upper-left Y:  146
  Relative upper-left X:  10
  Relative upper-left Y:  39
  Width: 1717
  Height: 934
  Depth: 24

146 + 934 = 1080

Area Chooser
  Absolute upper-left X:  2666
  Absolute upper-left Y:  810
  Relative upper-left X:  2666
  Relative upper-left Y:  810
  Width: 397
  Height: 299
  Depth: 32

810 + 299 = 1109
1109 - 32 = 1077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants