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 691181 - egg-list-box prelights wrong widget
egg-list-box prelights wrong widget
Status: RESOLVED FIXED
Product: egg-list-box
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: egg-list-box-maint
egg-list-box-maint
Depends on:
Blocks:
 
 
Reported: 2013-01-05 12:21 UTC by Cosimo Cecchi
Modified: 2013-01-08 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
egg-list-box: filter out motion-notify events for other windows (1.04 KB, patch)
2013-01-05 12:23 UTC, Cosimo Cecchi
none Details | Review
egg-list-box: translate motion-notify events for child windows (1.36 KB, patch)
2013-01-05 12:24 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2013-01-05 12:21:57 UTC
This is visible e.g. in gnome-control-center's Power or Search panels by hovering over a switch in an egg-list-box row.
I have two slightly different patches that both work to fix the bug; comments welcome.
Comment 1 Cosimo Cecchi 2013-01-05 12:23:11 UTC
Created attachment 232820 [details] [review]
egg-list-box: filter out motion-notify events for other windows

We need to filter out motion events not relative to our window; since we
use the relative coordinate to fetch the prelight/active child, we will
always fetch the wrong child when using coordinates that are not relative
to our window.

--

This is the simpler approach, just filter out motion events for child windows, like we do for enter/leave events.
Comment 2 Cosimo Cecchi 2013-01-05 12:24:01 UTC
Created attachment 232821 [details] [review]
egg-list-box: translate motion-notify events for child windows

When a motion event is received relative to a child window, translate
the y coordinate of the event relative to our own window, since that's what
we need to fetch the correct child.

--

Slightly more complex patch that tries to translate the motion event relative to the listbox's window before fetching the child.
Comment 3 Alexander Larsson 2013-01-08 08:08:09 UTC
I can easily imagine a case where approach 1 fails.

For instance, if you have a row with a windowed widget in it that takes up the whole height of the row (but not the whole width), then if the mouse enters the row over the widget then the row will not get a motion event, but part of the row that should be prelighted is visible (but is not prelighted).

Actually there are two issues there. a) the previous row should be un-prelighted, and b) the new row should *possibly* be prelighted (as per previous discussion about prelight propagation struff).

So, i think the second approach is more right. However, i disagree with its implementation. First of all gdk_window_get_origin() is a sync X call, and secondly it fails in more complicated cases like embedding with transformations. I think a gdk_window_coords_to_parent() loop like in gtk_widget_translate_coordinates() makes more sense.
Comment 4 Cosimo Cecchi 2013-01-08 16:10:55 UTC
Attachment 232821 [details] pushed as 706210c - egg-list-box: translate motion-notify events for child windows

Pushed to master a fixed version after Alex ACKed it on IRC