summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-09-16 09:32:45 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-09-16 09:32:45 -0400
commit6fe369c93ae3bd8c38ab1b3f6d75e76b32ace68e (patch)
treebfd465c1838490859b22fe167d68864eb8aac83c
parent34b26802d710d36224db25a4bb1e9ac5ff1e9843 (diff)
-rw-r--r--src/wayland-server.c29
-rw-r--r--src/wayland-server.h4
2 files changed, 18 insertions, 15 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c
index 4ee7796..ac1fda7 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -335,25 +335,25 @@ wl_client_destroy(struct wl_client *client)
}
static void
-lose_pointer_focus(struct wl_listener *listener,
- struct wl_resource *resource, uint32_t time)
+lose_pointer_focus_resource(struct wl_listener *listener,
+ struct wl_resource *resource, uint32_t time)
{
struct wl_input_device *device =
- container_of(listener, struct wl_input_device,
- pointer_focus_listener);
+ container_of(listener,
+ struct wl_input_device, pointer_focus_listener);
- wl_input_device_set_pointer_focus(device, NULL, time, 0, 0, 0, 0);
+ device->pointer_focus_resource = NULL;
}
static void
-lose_keyboard_focus(struct wl_listener *listener,
- struct wl_resource *resource, uint32_t time)
+lose_keyboard_focus_resource(struct wl_listener *listener,
+ struct wl_resource *resource, uint32_t time)
{
struct wl_input_device *device =
- container_of(listener, struct wl_input_device,
- keyboard_focus_listener);
+ container_of(listener,
+ struct wl_input_device, keyboard_focus_listener);
- wl_input_device_set_keyboard_focus(device, NULL, time);
+ device->keyboard_focus_resource = NULL;
}
WL_EXPORT void
@@ -362,8 +362,8 @@ wl_input_device_init(struct wl_input_device *device,
{
memset(device, 0, sizeof *device);
wl_list_init(&device->resource_list);
- device->pointer_focus_listener.func = lose_pointer_focus;
- device->keyboard_focus_listener.func = lose_keyboard_focus;
+ device->pointer_focus_listener.func = lose_pointer_focus_resource;
+ device->keyboard_focus_listener.func = lose_keyboard_focus_resource;
device->x = 100;
device->y = 100;
@@ -412,7 +412,7 @@ wl_input_device_set_pointer_focus(struct wl_input_device *device,
wl_resource_post_event(resource,
WL_INPUT_DEVICE_POINTER_FOCUS,
time, surface, x, y, sx, sy);
- wl_list_insert(surface->resource.destroy_listener_list.prev,
+ wl_list_insert(resource->destroy_listener_list.prev,
&device->pointer_focus_listener.link);
}
@@ -445,7 +445,7 @@ wl_input_device_set_keyboard_focus(struct wl_input_device *device,
wl_resource_post_event(resource,
WL_INPUT_DEVICE_KEYBOARD_FOCUS,
time, surface, &device->keys);
- wl_list_insert(surface->resource.destroy_listener_list.prev,
+ wl_list_insert(resource->destroy_listener_list.prev,
&device->keyboard_focus_listener.link);
}
@@ -463,6 +463,7 @@ wl_input_device_end_grab(struct wl_input_device *device, uint32_t time)
interface->end(device->grab, time);
device->grab->input_device = NULL;
device->grab = NULL;
+ device->grab_button = 0;
wl_list_remove(&device->grab_listener.link);
}
diff --git a/src/wayland-server.h b/src/wayland-server.h
index 9f5e8c3..a87f5b6 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -148,7 +148,8 @@ struct wl_surface {
struct wl_grab;
struct wl_grab_interface {
void (*motion)(struct wl_grab *grab,
- uint32_t time, int32_t x, int32_t y);
+ uint32_t time, struct wl_surface *surface,
+ int32_t x, int32_t y, int32_t sx, int32_t sy);
void (*button)(struct wl_grab *grab,
uint32_t time, int32_t button, int32_t state);
void (*end)(struct wl_grab *grab, uint32_t time);
@@ -157,6 +158,7 @@ struct wl_grab_interface {
struct wl_grab {
const struct wl_grab_interface *interface;
struct wl_input_device *input_device;
+ struct wl_surface *surface;
};
struct wl_input_device {