GNOME Bugzilla – Bug 535236
the dialog location change every time it's displayed
Last modified: 2008-07-02 20:49:17 UTC
the bug has been described on https://bugs.launchpad.net/ubuntu/+source/deskbar-applet/+bug/220796 "In Ubuntu 7.10, clicking the deskbar icon places the search dialog wherever it was last placed, making it easy to to place it where the entire list of options can be seen. In 8.04RC the search dialog pops up in a random location and will begin to "creep" progressively lower and lower on the screen with repeated invocations."
I already came across that myself. [1] tells me that this is somehow caused by the X server that can't tell me reliably where the window actually is on the screen. Therefore, the window moves. Unfortunately, I have no idea how to fix it. [1]: http://www.pygtk.org/pygtk2reference/class-gtkwindow.html#method-gtkwindow--get-position
I would see two possible solutions as pointed out in the reference you linked: Either use GRAVITY_STATIC, or use GnomeClient. The former seems to carry its own problems, and the latter seems not to be very well documented. Also, gnome.ui is deprecated, but I don't know if there is a successor for session handling.
I looked into nautilus to figure out how they do it. Turns out the fix is quite easy. The window must be moved before the window is displayed. It's now fixed in svn trunk.