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 696640 - GtkButton: Don't suppress unhandled mouse events
GtkButton: Don't suppress unhandled mouse events
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-26 13:24 UTC by Bastien Nocera
Modified: 2013-05-18 12:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkButton: Don't suppress unhandled mouse events (1.64 KB, patch)
2013-03-26 13:24 UTC, Bastien Nocera
reviewed Details | Review
GtkButton: Don't suppress unhandled mouse events (1.79 KB, patch)
2013-05-16 10:56 UTC, Bastien Nocera
committed Details | Review
GtkSwitch: Don't handle events from extra mouse buttons (3.73 KB, patch)
2013-05-16 12:28 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-03-26 13:24:53 UTC
This would fix the "back button" event on some mice not bubbling up
to the top-level window when a button is under the cursor.
Comment 1 Bastien Nocera 2013-03-26 13:24:56 UTC
Created attachment 239865 [details] [review]
GtkButton: Don't suppress unhandled mouse events

Mouse events that we do not handle should bubble up to the parent
widget, so they can be handled there, instead of disappearing inside
the button.
Comment 2 Emmanuele Bassi (:ebassi) 2013-03-26 13:45:58 UTC
Review of attachment 239865 [details] [review]:

it would probably be a good time to use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP instead of FALSE and TRUE (respectively) as the return value.

aside from that, I think it's a good thing to do, and we should audit the various widgets in gtk to ensure that they are not blocking event propagation unless they are actually handling events.
Comment 3 Bastien Nocera 2013-05-16 10:56:14 UTC
I went through the widgets handling ->touch, ->button_press_event and ->button_release_event, and found that:
- GtkButton was a broken one (as per above)
- GtkMenuShell's code always eats events, but I guess that's because a grab would be in place anyway(?)
- GtkSwitch doesn't check for the primary button and always eats events
Comment 4 Bastien Nocera 2013-05-16 10:56:25 UTC
Created attachment 244386 [details] [review]
GtkButton: Don't suppress unhandled mouse events

Mouse events that we do not handle should bubble up to the parent
widget, so they can be handled there, instead of disappearing inside
the button. Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.
Comment 5 Bastien Nocera 2013-05-16 12:28:46 UTC
Created attachment 244399 [details] [review]
GtkSwitch: Don't handle events from extra mouse buttons

Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.
Comment 6 Bastien Nocera 2013-05-18 12:50:28 UTC
Pushed to master and gtk-3-8 after review by Benjamin

Attachment 244386 [details] pushed as 7d54fc1 - GtkButton: Don't suppress unhandled mouse events
Attachment 244399 [details] pushed as 41b07bd - GtkSwitch: Don't handle events from extra mouse buttons