PDA

View Full Version : dfGUI for Linux -- saving graphs



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... :))

bwkaz
02-11-2004, 06:37 PM
OK, is it that nobody uses it, or is it that nobody cares? :p

bwkaz
04-18-2004, 05:26 PM
All right, given the extreme lack of opinion here, I've (finally) decided to just pop up a second window containing only the graph, then use it as the source for the screenshot.

It seems to work fairly well. The only thing is that when a set of gens is done, users get to see a pair of windows pop up in front of everything they're doing for about a half second total (250ms for each one). I've set up the window so that it shouldn't ask the user for where to put it, to try to help with that. In a window manager like twm, this is needed badly, otherwise the window manager will ask the user where to place the window every time it pops up. Which isn't horrible, but it is very very annoying. I just parented the window to the main dfGUI window, so that twm displays it more or less centered over the dfGUI window. I haven't tried to find out what happens if you're playing a full-screen game or something when this happens. I'm guessing that the screenshot will just fail again, but I do have to check that out for sure.

So, all of that being said, I'm getting ready to release a 3.3beta -- finally. I'll have to look at a few of the past few months' emails and messages here to ensure that I didn't forget about anything else, but I should have it up somewhere (likely the main dfGUI for Linux website) within a few days. I'll also post a real announcement at that time.

If anybody cares about what dfGUI for Linux does when it tries to save graphs, speak now or forever hold your peace! (j/k, I can change it later easily enough if somebody has a better idea)