From 07a302702226efe27e7e69fbe9643ed31f839f66 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 10 Mar 2015 12:14:50 +0100 Subject: idoscalemenuitem: translate motion event coordinates Fixes hover theming. --- src/idoscalemenuitem.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c index 9898b63..3b34ea4 100644 --- a/src/idoscalemenuitem.c +++ b/src/idoscalemenuitem.c @@ -574,6 +574,15 @@ ido_scale_menu_item_motion_notify_event (GtkWidget *menuitem, gtk_widget_get_allocation (priv->scale, &alloc); gtk_widget_translate_coordinates (menuitem, priv->scale, event->x, event->y, &x, &y); + /* don't translate coordinates when the scale has the "grab" - + * GtkRange expects coords relative to its event window in that case + */ + if (!priv->grabbed) + { + event->x = x; + event->y = y; + } + if (priv->grabbed || (x > 0 && x < alloc.width && y > 0 && y < alloc.height)) gtk_widget_event (priv->scale, (GdkEvent *) event); -- cgit v1.2.3