wlt: theme: fix bug in pointer-location computation
authorDavid Herrmann <dh.herrmann@googlemail.com>
Fri, 5 Oct 2012 11:21:12 +0000 (13:21 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Fri, 5 Oct 2012 11:21:12 +0000 (13:21 +0200)
We need to subtract the allocation because we get absolute pointer data as
input. This doesn't matter for the theme as long as it is the root widget,
but this might change when we introduce shadows.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/wlt_theme.c

index a15a84f..b4e65d1 100644 (file)
@@ -395,8 +395,8 @@ static void widget_pointer_motion(struct wlt_widget *widget,
                set_pointer_location(theme, LOC_NOWHERE);
                return;
        } else {
-               theme->pointer_x = x + theme->alloc.x;
-               theme->pointer_y = y + theme->alloc.y;
+               theme->pointer_x = x - theme->alloc.x;
+               theme->pointer_y = y - theme->alloc.y;
                set_pointer_location(theme, get_pointer_location(theme));
        }