0

I have been working with automating some of the user actions using xdotool and java in Ubuntu 18.04.1 LTS x64 Desktop. I am using java robot to move my mouse and xdotool (via Java Process.exec) to move my window and get its location.

I noticed that "xdotool getwindowgeometry" is not giving me accurate Y value for the location. While my java robot does. Suprisingly, "xdotool getmouselocation" has the same value with my java robot. Meaning "xdotool getmouselocation" and "xdotool getwindowgeometry" is not consistent at all.

The applications I used are:

- GEdit
- Gnome Terminal

Wherein, GEdit is off by -22 Y axis, where mouse Y location says 27 but this window gives me a Y value of -5.
Gnome Terminal is off by 68 Y axis, where mouse Y location says 27 but this window gives me a Y value of 95.

  • IIRC java also considers the decoration/frame as part of the window, though technically it's not (the frame is another window created by the window manager to which the application window is reparented). Java insisting on all window managers being reparenting ones (except for an exclusive list of wms listed explicitly) was quite an annoying bug; I don't know if they have ever fixed that idiocy or it's still there. – pizdelect Feb 8 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.