首页 > 解决方案 > Why xdotool's window position and geometry don't add up to the total size of the display?

问题描述

I'm trying to get a program to automatically crop a screenshot of the display to the correct size of the visible window.

Using this command to get the size and the position of the window:

$ xdotool getwindowfocus getwindowgeometry
Window 104857603
  Position: 0,81 (screen: 0)
  Geometry: 1920x1027

Using this command to get the display geometry:

$ xdotool getdisplaygeometry
1920 1080

It would be intuitive to think that the first value of the window's position plus the first value of the window's geometry would be equal to the first value of the display's geometry, and in this case it does (0 + 1920 = 1920). However when looking at the second output value 81 + 1027 > 1080. Why does that happen?

标签: linuxbashxdotool

解决方案


推荐阅读