I have a method that's supposed to return position and size of the active window. Works find on Plasma for example but on Gnome the geometry is a little bit larger then the real window as seen on this screenshot:
I'm using xcb_get_geometry_reply
to fetch the window information. Any idea what might be causing such behavior and how to mitigate it?
Any idea what might be causing such behavior
I think the values that you get are correct. You can see a shadow around the window (at least on the right and bottom side, but I bet that shadow is also present on the left and top). I bet that shadow is implemented by having a larger window and then making parts of it transparent.
So, the values that you get are correct, because they also include the shadow.
and how to mitigate it?
You could run xprop -frame
and/or xprop
in a terminal and then click on the window. Does GTK set some property that contain the size of the shadow? (I do not know the answer to this question; this is just a guess) (Is this even a GTK window?)