compositor-x11: Fix relative motion reporting for multiple outputs

Kristian Høgsberg 12 years ago
parent c088e2c011
commit 5006596a72
  1. 21
      src/compositor-x11.c
  2. 9
      src/compositor.c

@ -90,8 +90,8 @@ struct x11_compositor {
/* We could map multi-pointer X to multiple wayland seats, but /* We could map multi-pointer X to multiple wayland seats, but
* for now we only support core X input. */ * for now we only support core X input. */
struct weston_seat core_seat; struct weston_seat core_seat;
int prev_x; wl_fixed_t prev_x;
int prev_y; wl_fixed_t prev_y;
struct { struct {
xcb_atom_t wm_protocols; xcb_atom_t wm_protocols;
@ -1010,13 +1010,15 @@ x11_compositor_deliver_motion_event(struct x11_compositor *c,
if (!c->has_xkb) if (!c->has_xkb)
update_xkb_state_from_core(c, motion_notify->state); update_xkb_state_from_core(c, motion_notify->state);
output = x11_compositor_find_output(c, motion_notify->event); output = x11_compositor_find_output(c, motion_notify->event);
x = wl_fixed_from_int(motion_notify->event_x - c->prev_x); x = wl_fixed_from_int(motion_notify->event_x);
y = wl_fixed_from_int(motion_notify->event_y - c->prev_y); y = wl_fixed_from_int(motion_notify->event_y);
c->prev_x = motion_notify->event_x;
c->prev_y = motion_notify->event_y;
x11_output_transform_coordinate(output, &x, &y); x11_output_transform_coordinate(output, &x, &y);
notify_motion(&c->core_seat, weston_compositor_get_time(), x, y); notify_motion(&c->core_seat, weston_compositor_get_time(),
x - c->prev_x, y - c->prev_y);
c->prev_x = x;
c->prev_y = y;
} }
static void static void
@ -1033,13 +1035,14 @@ x11_compositor_deliver_enter_event(struct x11_compositor *c,
if (!c->has_xkb) if (!c->has_xkb)
update_xkb_state_from_core(c, enter_notify->state); update_xkb_state_from_core(c, enter_notify->state);
output = x11_compositor_find_output(c, enter_notify->event); output = x11_compositor_find_output(c, enter_notify->event);
c->prev_x = enter_notify->event_x;
c->prev_y = enter_notify->event_y;
x = wl_fixed_from_int(enter_notify->event_x); x = wl_fixed_from_int(enter_notify->event_x);
y = wl_fixed_from_int(enter_notify->event_y); y = wl_fixed_from_int(enter_notify->event_y);
x11_output_transform_coordinate(output, &x, &y); x11_output_transform_coordinate(output, &x, &y);
notify_pointer_focus(&c->core_seat, &output->base, x, y); notify_pointer_focus(&c->core_seat, &output->base, x, y);
c->prev_x = x;
c->prev_y = y;
} }
static int static int

@ -2078,15 +2078,8 @@ notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
struct wl_pointer *pointer = seat->seat.pointer; struct wl_pointer *pointer = seat->seat.pointer;
if (output) { if (output) {
clip_pointer_motion(seat, &x, &y); move_pointer(seat, x, y);
weston_seat_update_drag_surface(seat,
x - pointer->x,
y - pointer->y);
pointer->x = x;
pointer->y = y;
compositor->focus = 1; compositor->focus = 1;
weston_compositor_repick(compositor);
} else { } else {
compositor->focus = 0; compositor->focus = 0;
/* FIXME: We should call wl_pointer_set_focus(seat, /* FIXME: We should call wl_pointer_set_focus(seat,

Loading…
Cancel
Save