GNOME Bugzilla – Bug 588553
[csw] gdk_draw_pixbuf doesnt draw outside expose events sometimes
Last modified: 2009-07-23 20:46:24 UTC
This is the same issue as I described in Bug 588169, but it was a different problem after all. To reproduce, run the following code before and after the csw work: import gobject import gtk from gtk import gdk class Test(gtk.Widget): def __init__(self): gtk.Widget.__init__(self) def do_realize(self): self.set_flags(self.flags() | gtk.REALIZED) self.window = gdk.Window( self.get_parent_window(), width = self.allocation.width, height = self.allocation.height, window_type = gdk.WINDOW_CHILD, wclass = gdk.INPUT_OUTPUT, event_mask = (self.get_events() | gdk.EXPOSURE_MASK | gdk.BUTTON_MOTION_MASK | gdk.BUTTON_PRESS_MASK | gdk.BUTTON_RELEASE_MASK | gdk.POINTER_MOTION_MASK)) self.window.set_user_data(self) self.style.attach(self.window) def do_button_press_event(self, ev): pb = gdk.Pixbuf(gdk.COLORSPACE_RGB, False, 8, 100, 100) pb.fill(0xff0000ff) self.window.draw_pixbuf( None, pb, 0, 0, 0, 0, 100, 100, gdk.RGB_DITHER_MAX, 0, 0) def do_size_allocate(self, alloc): self.allocation = alloc if self.flags() & gtk.REALIZED: self.window.move_resize(*alloc) gobject.type_register(Test) win = gtk.Window() win.add(Test()) win.set_default_size(100, 100) win.show_all() gtk.main() Before csw, the window becomes red when the window is clicked. After csw, it remains black. If you use self.window.drag_rgb_image() instead of self.window.draw_pixbuf() to draw the red image, it will work with csw. Maybe there is something wrong with the draw_pixbuf() method?
Created attachment 139103 [details] Test case This is a c-based version of the testcase, it uses draw_pixbuf on first click and gdk_draw_rgb_image on second click.
Commit 9d69355e6f000ba2b8c7ae8897a04f3d6c8c19da fixes this.
*** Bug 588436 has been marked as a duplicate of this bug. ***