fullscreen-shell: Test for device presence properly

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 <derekf@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
dev
Derek Foreman 9 years ago committed by Bryce Harrington
parent 006cf67c77
commit b41b59e2fa
  1. 4
      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);

Loading…
Cancel
Save