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 606453 - button-release-event no longer fires unless BUTTON_PRESS_MASK
button-release-event no longer fires unless BUTTON_PRESS_MASK
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
csw
Depends on:
Blocks:
 
 
Reported: 2010-01-08 21:06 UTC by Akkana Peck
Modified: 2010-01-15 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small test script showing the problem (1.68 KB, text/x-python)
2010-01-08 21:06 UTC, Akkana Peck
Details

Description Akkana Peck 2010-01-08 21:06:37 UTC
Created attachment 151065 [details]
small test script showing the problem

In past versions of pygtk, I've been able to do this:

        self.drawing_area.set_events(gtk.gdk.EXPOSURE_MASK |
                                     gtk.gdk.BUTTON_RELEASE_MASK )
        self.drawing_area.connect("button-release-event", self.button_event)

and the button release events would fire. With 2.16.0, I have to do this:

        self.drawing_area.set_events(gtk.gdk.EXPOSURE_MASK |
                                     gtk.gdk.BUTTON_PRESS_MASK |
                                     gtk.gdk.BUTTON_RELEASE_MASK )
        self.drawing_area.connect("button-release-event", self.button_event)

The button release doesn't fire unless I have both BUTTON_RELEASE_MASK *and* BUTTON_PRESS_MASK.

I can't find any documentation anywhere that mentions this, so I'm guessing it's a regression and not intentional. For instance, googling
"button-release-event" BUTTON_PRESS_MASK site:pygtk.org
finds nothing.
Comment 1 Gian Mario Tagliaretti 2010-01-09 05:49:29 UTC
*If* there is a regression it cannot be in PyGTK itself since we don't do anything special with events, reassigning to GTK itself.
Comment 2 Alexander Larsson 2010-01-15 11:22:28 UTC
This is the same issue as:

http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00087.html

The example you show only works with a non-reparenting WM (like compiz), and is not a good way to code for the reasons listed in the mail above.

To work in gtk 2.18 and in 2.16 with some WMs you just have to also select for button presses.