|
From: João L. S. <js...@fc...> - 2010-07-24 17:18:31
|
On 07/13/2010 02:31 AM, John Hunter wrote: > On Mon, Jul 12, 2010 at 8:05 PM, John Hunter<jd...@gm...> wrote: >> All of which is discouraging: we both see bugs but different ones on >> linux, the appearance of the bug is caused by adding a combobox which >> is not used (on my system), the bug appears on some platforms (linux) >> but not others (win) and it appears for both gtk and gtkagg. > > The last thing I'll add for now is that my bug, the black pixel noise > (fills the axes window when motion starts in a zoom-to-rect event) > which may be unrelated to your bug, is happening in > backend_gtk.NavigationToolbar2GTK.draw_rubberband in the pair of > calls: > > # this is used to copy the background that the zoom to rect > "rubberband" will be drawn over > self._imageBack = axrect, drawable.get_image(*axrect) > > # this is used to restore the background before redrawing the > rectangle for the zoom box > drawable.draw_image(gc, imageBack, 0, 0, *lastrect) > > Since the bug is only exposed when a combo box is added to the > hierarchy, and appears to be platform or gtk specific, I'm suspecting > a gtk bug at this point. But I don't have anything conclusive or a > minimal example which I could use to post to the gtk list. The mpl > calls and values (axrect, lastrect, etc) look correct on inspection. > Somehow the call to drawable.get_image is getting a buffer full of > noise if and only if the combobox is added to the vbox. > > JDH From what I could understand from the pygtk documentation get_image / draw_image are client-side operations. In particular: "If the source drawable is a Gdk::Window and partially offscreen or obscured, then the obscured portions of the returned image will contain undefined data." Anyway they recommend using Pixmap, which is server-side and a offscreen drawable. I've attached a patch that replaces the get_image / draw_image with Pixmap operations and fixes this bug. I've tested this patch on Linux and Windows. Regards, João Luís |