From: Rob Bradford Date: Tue, 25 Jun 2013 17:56:42 +0000 (+0100) Subject: compositor-drm: Enable seat constraining when configured in weston.ini X-Git-Tag: 0.1.0~170 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcaca098f8d5afd0e60141058c89093741a5eeb3;p=platform%2Fupstream%2Flibinput.git compositor-drm: Enable seat constraining when configured in weston.ini This change tweaks weston_pointer_clamp to take into consideration if a seat is constrained to a particular output by only considering the pointer position valid if it is within the output we a constrained to. This function is also used for the initial warping of the pointer when a constraint is first established. The other two changes are the application of the constraint when either a new device added or a new output created and therefore outputs and input devices can be brought up in either order. v2: the code in create_output_for_connector has been spun off into a new function setup_output_seat_constraint (Ander). The inappropriate warping behaviour has been resolved by using weston_pointer_clamp (Pekka). --- diff --git a/src/udev-seat.c b/src/udev-seat.c index bd25535..ec6dc4b 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -115,6 +115,11 @@ device_added(struct udev_device *udev_device, struct udev_input *input) wl_list_insert(seat->devices_list.prev, &device->link); + if (seat->base.output && seat->base.pointer) + weston_pointer_clamp(seat->base.pointer, + &seat->base.pointer->x, + &seat->base.pointer->y); + return 0; }