mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-10 13:29:48 -05:00
Feed button events through compositor.
This also generalizes the code to send events to a surface a bit.
This commit is contained in:
parent
715a081cf4
commit
5a75c90d01
4 changed files with 42 additions and 36 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue