compositor-x11: stop using input_loop

X11 is the only backend that still used the input event loop.

This patch is an identical rewrite of
6deb09ef8a which was then reverted in
3bebe6461a for reasons unrecorded. This
patch is also the revert of 22ba60e514.

Originally input devices were moved into their own event loop in
7ea10864c2 and the reason for that is
explained in 7dbf5e2ea7.

The idea behind the input event loop was that it would be beneficial to
process and relay input events to clients just once during an output
repaint cycle, because clients cannot update the image on screen any
faster anyway. All input events also carry a timestamp, so we didn't
lose any timing information. This was supposed to save power by reducing
the process wake-ups and context switches. There was also a mention of
reducing lag.

However, the concept of an output repaint loop does not really work out
when you have several outputs, but the input devices are not exclusive
to a certain output.

The logic for driving the input event loop in Weston core was written to
assume a single output. When you have multiple outputs with independent
repaint cycles, the input event loop handling becomes fairly random, one
output freezes input while another output thaws it, etc.

The DRM backend stopped using the input event loop when it started using
the libinput input backend, which became the default in
3f5e906268, and the old code was finally
ripped out in 823ad33ef3.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
dev
Pekka Paalanen 9 years ago
parent 94cb06a208
commit 157109b6d5
  1. 4
      src/compositor-x11.c

@ -1576,6 +1576,7 @@ x11_backend_create(struct weston_compositor *compositor,
{
struct x11_backend *b;
struct x11_output *output;
struct wl_event_loop *loop;
struct weston_config_section *section;
int i, x = 0, output_count = 0;
int width, height, scale, count;
@ -1705,8 +1706,9 @@ x11_backend_create(struct weston_compositor *compositor,
x = pixman_region32_extents(&output->base.region)->x2;
}
loop = wl_display_get_event_loop(compositor->wl_display);
b->xcb_source =
wl_event_loop_add_fd(compositor->input_loop,
wl_event_loop_add_fd(loop,
xcb_get_file_descriptor(b->conn),
WL_EVENT_READABLE,
x11_backend_handle_event, b);

Loading…
Cancel
Save