From 5a75c90d0153eb8f57993d17a3a0884ed8eb6907 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 10 Dec 2008 13:16:50 -0500 Subject: Feed button events through compositor. This also generalizes the code to send events to a surface a bit. --- egl-compositor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'egl-compositor.c') diff --git a/egl-compositor.c b/egl-compositor.c index c05f363..917364f 100644 --- a/egl-compositor.c +++ b/egl-compositor.c @@ -758,8 +758,8 @@ notify_pointer_motion(struct wl_compositor *compositor, if (es) { sx = (x - es->map.x) * es->width / es->map.width; sy = (y - es->map.y) * es->height / es->map.height; - wl_display_post_surface_motion(ec->wl_display, es->wl_surface, - source, x, y, sx, sy); + wl_surface_post_event(es->wl_surface, source, + WL_INPUT_MOTION, x, y, sx, sy); } ec->pointer->map.x = x - hotspot_x; @@ -784,6 +784,10 @@ notify_pointer_button(struct wl_compositor *compositor, if (es) { wl_list_remove(&es->link); wl_list_insert(ec->surface_list.prev, &es->link); + + /* FIXME: Swallow click on raise? */ + wl_surface_post_event(es->wl_surface, source, + WL_INPUT_BUTTON, button, state); } schedule_repaint(ec); -- cgit v1.2.3