Hello,
I`m developing an application using the motif toolkit to display line traces in the manner of a multichannel osciloscope. This is a linux platform.
The window draws a number of horizontal traces obtained from a data source. The application has been working fine for a while. When we started using the xinerama extension or very large resolutions (> 1280x1024). We started observing an undesirable behavior
The application, when is resized, re-creates the pixmaps where the data is drawn. The old ones are freed and new ones are created according to the new size of the window. Then, the program continues operating by receiving new data periodically and drawing them.
The problem is that _sometimes_, after resizing to a new window size (usually larger than the old one and relatively large compared to the screen size) the application slows down and does not draw new data as fast and the X server hits more than 97% of CPU usage. The problem is serious because if the user clicks on the application to get the menu, the pointer gets grabbed but nothing happens for several minutes and the machine is effectively locked.
From studying the problem, it seems that the application can`t proccess its events fast enough.
If the data drawing is stopped and the application is idle, then resized it to a smaller size or just a different size, makes the problem go away.
I suspect that the problem lies somewhere in the way the pixmaps are handled after resizing.
Can some of you suggest a debugging approach to this problem? Any documentation I could look at for safely handling pixmaps? Could this be an X server problem? We`ve seen this behavior since xfree 4.0. We`ve also tried different video cards.
This may not be the best forum, but I would appreciate any suggestions.
Rafael
In no particular order
You could use xmodmap to track conventional (i.e. non-extension) events and requests.
You could be sure to handle any extra events being sent by the extension.
You could be sure to wait until all resizes are done before re-allocating. You may be doing multiple reallocations.
You may want to see if the shared-memory extension would be of use to you.