I need to find the position and size of the window, but I cannot figure out how to do this. For example, if I try:
id.get_geometry() # "id" is Xlib.display.Window
I get something like this:
data = {'height': 2540, 'width': 1440, 'depth': 24, 'y': 0, 'x': 0, 'border_width': 0 'root': <Xlib.display.Window 0x0000026a> 'sequence_number': 63}
I need to find the position and size of the window, so my problem is: "y", "x" and "border_width" are always 0; even worse, "height" and "width" return without a window frame.
In this case, on my X-screen (its dimensions are 4400x2560) I expected x = 1280, y = 0, width = 1440, height = 2560.
In other words, I'm looking for the python equivalent for:
#!/bin/bash id=$1 wmiface framePosition $id wmiface frameSize $id
If you think that Xlib is not what I want, feel free to suggest a non-Xlib solution in python if it can take a window id as an argument (e.g. bash script above). The obvious workaround for using bash script output in python code doesn't seem right.
source share