server: fix event sending type mismatches
authorPekka Paalanen <ppaalanen@gmail.com>
Fri, 2 Mar 2012 16:09:27 +0000 (18:09 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Fri, 2 Mar 2012 16:09:27 +0000 (18:09 +0200)
These were not bugs in practice, because the first (and only) field of
struct wl_surface is struct wl_resource.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/data-device.c
src/wayland-server.c

index fc34a18..aff2177 100644 (file)
@@ -201,7 +201,7 @@ drag_grab_focus(struct wl_pointer_grab *grab, uint32_t time,
                offer = wl_data_source_send_offer(device->drag_data_source,
                                                  resource);
 
-               wl_data_device_send_enter(resource, time, surface,
+               wl_data_device_send_enter(resource, time, &surface->resource,
                                          x, y, offer);
 
                device->drag_focus = surface;
index 4c3d2c0..899c094 100644 (file)
@@ -581,14 +581,15 @@ wl_input_device_set_pointer_focus(struct wl_input_device *device,
        if (device->pointer_focus_resource) {
                wl_input_device_send_pointer_leave(
                        device->pointer_focus_resource,
-                       time, device->pointer_focus);
+                       time, &device->pointer_focus->resource);
                wl_list_remove(&device->pointer_focus_listener.link);
        }
 
        resource = find_resource_for_surface(&device->resource_list, surface);
        if (resource) {
                wl_input_device_send_pointer_enter(resource, time,
-                                                  surface, sx, sy);
+                                                  &surface->resource,
+                                                  sx, sy);
                wl_list_insert(resource->destroy_listener_list.prev,
                               &device->pointer_focus_listener.link);
        }
@@ -612,14 +613,15 @@ wl_input_device_set_keyboard_focus(struct wl_input_device *device,
        if (device->keyboard_focus_resource) {
                wl_input_device_send_keyboard_leave(
                        device->keyboard_focus_resource,
-                       time, device->keyboard_focus);
+                       time, &device->keyboard_focus->resource);
                wl_list_remove(&device->keyboard_focus_listener.link);
        }
 
        resource = find_resource_for_surface(&device->resource_list, surface);
        if (resource) {
                wl_input_device_send_keyboard_enter(resource, time,
-                                                   surface, &device->keys);
+                                                   &surface->resource,
+                                                   &device->keys);
                wl_list_insert(resource->destroy_listener_list.prev,
                               &device->keyboard_focus_listener.link);
        }