After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 588553 - [csw] gdk_draw_pixbuf doesnt draw outside expose events sometimes
[csw] gdk_draw_pixbuf doesnt draw outside expose events sometimes
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
csw
Depends on:
Blocks:
 
 
Reported: 2009-07-14 16:13 UTC by Björn Lindqvist
Modified: 2009-07-23 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (1.28 KB, text/plain)
2009-07-23 20:10 UTC, Alexander Larsson
Details

Description Björn Lindqvist 2009-07-14 16:13:51 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?
Comment 1 Alexander Larsson 2009-07-23 20:10:42 UTC
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.
Comment 2 Alexander Larsson 2009-07-23 20:11:50 UTC
Commit 9d69355e6f000ba2b8c7ae8897a04f3d6c8c19da fixes this.
Comment 3 Alexander Larsson 2009-07-23 20:46:24 UTC
*** Bug 588436 has been marked as a duplicate of this bug. ***