jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.24k stars 318 forks source link

getwindowgeometry reports incorrect coordinates #176

Open michaelgilch opened 7 years ago

michaelgilch commented 7 years ago

If i use: xdotool windowmove 0 26 the window is properly moved to the far left of my screen and butted up against my 25px panel. However, if I then run xdotool getwindowgeometry it reports Position: 0,72

If I use windowmove to y 72, it is definitely not in the same position.

michaelgilch commented 7 years ago

Upon further examination, and experimenting with my window decorator size and panel size, I have found the following: Panel = 25 Window Decorator = 23 Yields: Absolute Y Position = 49 (Panel + Window Decorator) Relative Y Position = 23 (Offset into Workable Desktop Space) Position 72 = Absolute Y + Relative Y (INCORRECT) Should be Position 26 = Absolute Y - Relative Y

guzzard commented 7 years ago

Also have this issue.

For example placing a terminal window (GTK2) at 0,0 and then running "xdotool getactivewindow getwindowgeometry --shell" gives the following results:

WINDOW=73400323 X=12 Y=55 WIDTH=1442 HEIGHT=980 SCREEN=0

X, Y and HEIGHT are incorrect. Height is not including the titlebar of of the window.

With a GTK3 window at 0,0 I get the following results:

WINDOW=90177784 X=-12 Y=-11 WIDTH=1547 HEIGHT=1423 SCREEN=0

X, Y, WIDTH and HEIGHT are incorrect. Both width and height are bigger than the actual window.

UndeadDevel commented 10 months ago

Can confirm that this is still an issue; windowmove should behave consistently with the coordinates obtained by getwindowgeometry, but the latter ignores the titlebar and window border, while the former does not. Looks like a fix has been prepared in this fork.