There is a strange thing going on with one of our applications.

There is a window that every now and then once you have it up causes
the X-server to go very high in cpu. If you have the window up and
don't do anything the X server cpu drops but if you slowly move mouse
across the window the cpu goes really high. This only happens
sometimes - the window can be fine for hours and then the problem
occurs. Other times you can move mouse across window and x cpu is
fine. Also once this occurs any time this window has to repaint it
takes a really long time. Other apps/windows are fine. If window is
minimized the cpu drops as well. The window is made up of many
subwindows etc. - it is a grid. I'm wondering what is the best way to
debug this - to try and find out what is the x-server doing ?