While it does not exactly solve the problem at hand, you might want to have a look at x2x, too. It basically does the same for 2 X servers - which is what you have, too (when looking at it a slight bit differently). Or synergy, which is basically a x2x with more bells and whistles.
|