diff --git a/src/wayland/meta-wayland-pointer-gesture-hold.c b/src/wayland/meta-wayland-pointer-gesture-hold.c index 90c63cd25..5ccc42407 100644 --- a/src/wayland/meta-wayland-pointer-gesture-hold.c +++ b/src/wayland/meta-wayland-pointer-gesture-hold.c @@ -139,15 +139,19 @@ meta_wayland_pointer_gesture_hold_create_new_resource (MetaWaylandPointer *point MetaWaylandPointerClient *pointer_client; struct wl_resource *res; - pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client); - g_return_if_fail (pointer_client != NULL); - res = wl_resource_create (client, &zwp_pointer_gesture_hold_v1_interface, wl_resource_get_version (pointer_resource), id); wl_resource_set_implementation (res, &pointer_gesture_hold_interface, pointer, meta_wayland_pointer_unbind_pointer_client_resource); - wl_list_insert (&pointer_client->hold_gesture_resources, - wl_resource_get_link (res)); + + if (pointer) + { + pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client); + g_return_if_fail (pointer_client != NULL); + + wl_list_insert (&pointer_client->hold_gesture_resources, + wl_resource_get_link (res)); + } } void diff --git a/src/wayland/meta-wayland-pointer-gesture-pinch.c b/src/wayland/meta-wayland-pointer-gesture-pinch.c index 32a6bad69..16f106a76 100644 --- a/src/wayland/meta-wayland-pointer-gesture-pinch.c +++ b/src/wayland/meta-wayland-pointer-gesture-pinch.c @@ -170,15 +170,19 @@ meta_wayland_pointer_gesture_pinch_create_new_resource (MetaWaylandPointer *poin MetaWaylandPointerClient *pointer_client; struct wl_resource *res; - pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client); - g_return_if_fail (pointer_client != NULL); - res = wl_resource_create (client, &zwp_pointer_gesture_pinch_v1_interface, wl_resource_get_version (gestures_resource), id); wl_resource_set_implementation (res, &pointer_gesture_pinch_interface, pointer, meta_wayland_pointer_unbind_pointer_client_resource); - wl_list_insert (&pointer_client->pinch_gesture_resources, - wl_resource_get_link (res)); + + if (pointer) + { + pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client); + g_return_if_fail (pointer_client != NULL); + + wl_list_insert (&pointer_client->pinch_gesture_resources, + wl_resource_get_link (res)); + } } void diff --git a/src/wayland/meta-wayland-pointer-gesture-swipe.c b/src/wayland/meta-wayland-pointer-gesture-swipe.c index dc7abb3c8..924a9ded1 100644 --- a/src/wayland/meta-wayland-pointer-gesture-swipe.c +++ b/src/wayland/meta-wayland-pointer-gesture-swipe.c @@ -166,15 +166,19 @@ meta_wayland_pointer_gesture_swipe_create_new_resource (MetaWaylandPointer *poin MetaWaylandPointerClient *pointer_client; struct wl_resource *res; - pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client); - g_return_if_fail (pointer_client != NULL); - res = wl_resource_create (client, &zwp_pointer_gesture_swipe_v1_interface, wl_resource_get_version (pointer_resource), id); wl_resource_set_implementation (res, &pointer_gesture_swipe_interface, pointer, meta_wayland_pointer_unbind_pointer_client_resource); - wl_list_insert (&pointer_client->swipe_gesture_resources, - wl_resource_get_link (res)); + + if (pointer) + { + pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client); + g_return_if_fail (pointer_client != NULL); + + wl_list_insert (&pointer_client->swipe_gesture_resources, + wl_resource_get_link (res)); + } } void