linux - 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?
解决方案
推荐阅读
- python - 有没有办法使用 Python 自动校准 OpenCV 中的 detectMultiscale() 中的比例和邻居?
- php - 函数没有被回调给登录用户
- json - 如何从 JSON 中获取值,其中 JSON 以 RestAssured 中的 Array Block 开头
- reactjs - 我想使用 D3 和 Chartjs 在 React 中绘制前 100 行本地 CSV
- mysql-workbench - MySQL Workbench 8.0 CE:获取上一帧按钮丢失
- excel - 用于打开 Visual Basic 编辑器的 Excel 宏
- amazon-web-services - 我无法弄清楚我在 AWS IAM 中缺少允许编辑防火墙规则的权限
- mysql - 用户'root'@'localhost'的访问被拒绝-在vps上启动一个spring项目
- gradle - Gradle 与远程平面 IVY 存储库的依赖关系:如何摆脱 jar 文件中添加的破折号
- python - 如何在python中从不同长度的列表创建字典