From b41b59e2fae83124f90ce54b6ae3f088bfec3338 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 15 Jul 2015 13:00:47 -0500 Subject: [PATCH] fullscreen-shell: Test for device presence properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should be testing device counts, not pointers. The pointers are persistent state that never gets freed, and are an inaccurate indicator of device presence after the last release. Signed-off-by: Derek Foreman Reviewed-by: Jonas Ã…dahl --- fullscreen-shell/fullscreen-shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fullscreen-shell/fullscreen-shell.c b/fullscreen-shell/fullscreen-shell.c index ab9c420b..cae6ed5f 100644 --- a/fullscreen-shell/fullscreen-shell.c +++ b/fullscreen-shell/fullscreen-shell.c @@ -102,7 +102,7 @@ seat_caps_changed(struct wl_listener *l, void *data) listener = container_of(l, struct pointer_focus_listener, seat_caps); /* no pointer */ - if (seat->pointer) { + if (seat->pointer_device_count) { if (!listener->pointer_focus.link.prev) { wl_signal_add(&seat->pointer->focus_signal, &listener->pointer_focus); @@ -113,7 +113,7 @@ seat_caps_changed(struct wl_listener *l, void *data) } } - if (seat->keyboard && seat->keyboard->focus != NULL) { + if (seat->keyboard_device_count && seat->keyboard->focus != NULL) { wl_list_for_each(fsout, &listener->shell->output_list, link) { if (fsout->surface) { weston_surface_activate(fsout->surface, seat);