bwkaz
02-08-2004, 06:49 PM
It has come to my attention that saving the graphs in dfGUI for Linux doesn't seem to work when it's running behind other windows. I get a black rectangle, and others get black rectangles with splotches of blue, or other strange things. Definitely not our graphs.
I think that the problem is the way that X works. dfGUI is asking the X server for a pixmap containing the contents of dfGUI's graph widget, and apparently the X server is getting it wrong when the dfGUI window is not in front of everything else on the desktop (which sort of makes sense to me -- the X server wouldn't want to keep copies of all windows laying around; if it's clipped, throw it away to save memory). It wouldn't surprise me if something went really wrong if dfGUI was iconified or shaded (wrong like segfaulting dfGUI), but I haven't tried that.
Anyway, I've come to a point where I'm not really sure how to proceed. If I leave it the way it is, then dfGUI will have to be running normally, in the foreground, when a generation set is done (250 gens) in order for it to properly save the graphs. The other option is to add a call to gtk_window_present(), which will de-iconify and un-shade it, and then bring it to the top of the z-order. Then I can save the graphs, but I can't pop it back down in the z-order automatically (I can iconify and/or shade it, I think, if it was originally iconified and/or shaded).
I think the second option is fairly annoying if you're working on something else, myself. But I'll put it to the users -- which one is the lesser of two evils?
Or does anybody have another idea that I haven't thought of? (I hope so... :))
I think that the problem is the way that X works. dfGUI is asking the X server for a pixmap containing the contents of dfGUI's graph widget, and apparently the X server is getting it wrong when the dfGUI window is not in front of everything else on the desktop (which sort of makes sense to me -- the X server wouldn't want to keep copies of all windows laying around; if it's clipped, throw it away to save memory). It wouldn't surprise me if something went really wrong if dfGUI was iconified or shaded (wrong like segfaulting dfGUI), but I haven't tried that.
Anyway, I've come to a point where I'm not really sure how to proceed. If I leave it the way it is, then dfGUI will have to be running normally, in the foreground, when a generation set is done (250 gens) in order for it to properly save the graphs. The other option is to add a call to gtk_window_present(), which will de-iconify and un-shade it, and then bring it to the top of the z-order. Then I can save the graphs, but I can't pop it back down in the z-order automatically (I can iconify and/or shade it, I think, if it was originally iconified and/or shaded).
I think the second option is fairly annoying if you're working on something else, myself. But I'll put it to the users -- which one is the lesser of two evils?
Or does anybody have another idea that I haven't thought of? (I hope so... :))