compositor: Fix a couple of left-over wl_resource direct access
diff --git a/src/bindings.c b/src/bindings.c
index 558208c..3194414 100644
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -155,6 +155,7 @@
 	struct binding_keyboard_grab *b =
 		container_of(grab, struct binding_keyboard_grab, grab);
 	struct wl_resource *resource;
+	struct wl_client *client;
 	struct wl_display *display;
 	enum wl_keyboard_key_state state = state_w;
 	uint32_t serial;
@@ -169,7 +170,8 @@
 			free(b);
 		}
 	} else if (resource) {
-		display = wl_client_get_display(resource->client);
+		client = wl_resource_get_client(resource);
+		display = wl_client_get_display(client);
 		serial = wl_display_next_serial(display);
 		wl_keyboard_send_key(resource, serial, time, key, state);
 	}
diff --git a/src/compositor.c b/src/compositor.c
index 90a9278..43d8965 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1679,7 +1679,7 @@
 compositor_create_surface(struct wl_client *client,
 			  struct wl_resource *resource, uint32_t id)
 {
-	struct weston_compositor *ec = resource->data;
+	struct weston_compositor *ec = wl_resource_get_user_data(resource);
 	struct weston_surface *surface;
 
 	surface = weston_surface_create(ec);