summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-07-15 13:00:46 -0500
committerBryce Harrington <bryce@osg.samsung.com>2015-07-31 15:16:03 -0700
commit006cf67c77d0587f3ead1c7551a542516cb19bf1 (patch)
treeddd298d07f8b2f7fe3654e65913fa61a19db1351 /desktop-shell
parent60d97311be5492b02843c4e9d46f818d43499dae (diff)
desktop-shell: Check 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 a release. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index d08b0d81..009e6710 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3105,20 +3105,20 @@ shell_seat_caps_changed(struct wl_listener *listener, void *data)
seat = container_of(listener, struct shell_seat, caps_changed_listener);
- if (seat->seat->keyboard &&
+ if (seat->seat->keyboard_device_count &&
wl_list_empty(&seat->keyboard_focus_listener.link)) {
wl_signal_add(&seat->seat->keyboard->focus_signal,
&seat->keyboard_focus_listener);
- } else if (!seat->seat->keyboard) {
+ } else if (!seat->seat->keyboard_device_count) {
wl_list_remove(&seat->keyboard_focus_listener.link);
wl_list_init(&seat->keyboard_focus_listener.link);
}
- if (seat->seat->pointer &&
+ if (seat->seat->pointer_device_count &&
wl_list_empty(&seat->pointer_focus_listener.link)) {
wl_signal_add(&seat->seat->pointer->focus_signal,
&seat->pointer_focus_listener);
- } else if (!seat->seat->pointer) {
+ } else if (!seat->seat->pointer_device_count) {
wl_list_remove(&seat->pointer_focus_listener.link);
wl_list_init(&seat->pointer_focus_listener.link);
}