};
static void
-install_binding_grab(struct wl_seat *seat,
- uint32_t time, uint32_t key)
+install_binding_grab(struct weston_seat *seat, uint32_t time, uint32_t key)
{
struct binding_keyboard_grab *grab;
wl_list_for_each(b, &compositor->key_binding_list, link) {
if (b->key == key && b->modifier == seat->modifier_state) {
weston_key_binding_handler_t handler = b->handler;
- handler(&seat->seat, time, key, b->data);
+ handler(seat, time, key, b->data);
/* If this was a key binding and it didn't
* install a keyboard grab, install one now to
* swallow the key release. */
- if (seat->seat.keyboard->grab ==
- &seat->seat.keyboard->default_grab)
- install_binding_grab(&seat->seat, time, key);
+ if (seat->keyboard->grab ==
+ &seat->keyboard->default_grab)
+ install_binding_grab(seat, time, key);
}
}
}
wl_list_for_each(b, &compositor->button_binding_list, link) {
if (b->button == button && b->modifier == seat->modifier_state) {
weston_button_binding_handler_t handler = b->handler;
- handler(&seat->seat, time, button, b->data);
+ handler(seat, time, button, b->data);
}
}
}
wl_list_for_each(b, &compositor->axis_binding_list, link) {
if (b->axis == axis && b->modifier == seat->modifier_state) {
weston_axis_binding_handler_t handler = b->handler;
- handler(&seat->seat, time, axis, value, b->data);
+ handler(seat, time, axis, value, b->data);
return 1;
}
}
count++;
handler = binding->handler;
- handler(&seat->seat, time, key, binding->data);
+ handler(seat, time, key, binding->data);
}
return count;
struct clipboard *clipboard =
container_of(listener, struct clipboard, selection_listener);
struct weston_seat *seat = data;
- struct wl_data_source *source = seat->seat.selection_data_source;
+ struct wl_data_source *source = seat->selection_data_source;
const char **mime_types;
int p[2];
if (source == NULL) {
if (clipboard->source)
- wl_seat_set_selection(&seat->seat,
- &clipboard->source->base,
- clipboard->source->serial);
+ weston_seat_set_selection(seat,
+ &clipboard->source->base,
+ clipboard->source->serial);
return;
} else if (source->accept == clipboard_source_accept) {
/* Callback for our data source. */
clipboard->source =
clipboard_source_create(clipboard, mime_types[0],
- seat->seat.selection_serial, p[0]);
+ seat->selection_serial, p[0]);
if (clipboard->source == NULL)
return;
}
clipboard->selection_listener.notify = clipboard_set_selection;
clipboard->destroy_listener.notify = clipboard_destroy;
- wl_signal_add(&seat->seat.selection_signal,
+ wl_signal_add(&seat->selection_signal,
&clipboard->selection_listener);
wl_signal_add(&seat->destroy_signal,
&clipboard->destroy_listener);
}
static void
-switch_vt_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct drm_compositor *ec = data;
}
static void
-planes_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+planes_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct drm_compositor *c = data;
}
static void
-switch_vt_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct fbdev_compositor *ec = data;
wl_list_for_each_safe(device, next, &seat->devices_list, link)
evdev_device_destroy(device);
- if (seat->base.seat.keyboard)
+ if (seat->base.keyboard)
notify_keyboard_focus_out(&seat->base);
}
}
static void
-switch_vt_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct rpi_compositor *ec = data;
if (input->focus)
notify_motion(&input->base, time,
x - wl_fixed_from_int(c->border.left) -
- input->base.seat.pointer->x,
+ input->base.pointer->x,
y - wl_fixed_from_int(c->border.top) -
- input->base.seat.pointer->y);
+ input->base.pointer->y);
}
static void
update_xkb_state_from_core(struct x11_compositor *c, uint16_t x11_mask)
{
uint32_t mask = get_xkb_mod_mask(c, x11_mask);
- struct weston_keyboard *keyboard = &c->core_seat.keyboard;
+ struct weston_keyboard *keyboard = &c->core_seat.keyboard_instance;
xkb_state_update_mask(c->core_seat.xkb_state.state,
keyboard->modifiers.mods_depressed & mask,
/* If a pointer falls outside the outputs new geometry, move it to its
* lower-right corner */
wl_list_for_each(seat, &output->compositor->seat_list, link) {
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
int32_t x, y;
if (!pointer)
wl_list_remove(&surface->layer_link);
wl_list_for_each(seat, &surface->compositor->seat_list, link) {
- if (seat->seat.keyboard &&
- seat->seat.keyboard->focus == &surface->surface)
- weston_keyboard_set_focus(seat->seat.keyboard, NULL);
- if (seat->seat.pointer &&
- seat->seat.pointer->focus == &surface->surface)
- weston_pointer_set_focus(seat->seat.pointer,
+ if (seat->keyboard &&
+ seat->keyboard->focus == &surface->surface)
+ weston_keyboard_set_focus(seat->keyboard, NULL);
+ if (seat->pointer &&
+ seat->pointer->focus == &surface->surface)
+ weston_pointer_set_focus(seat->pointer,
NULL,
wl_fixed_from_int(0),
wl_fixed_from_int(0));
};
struct weston_pointer {
- struct wl_seat *seat;
+ struct weston_seat *seat;
struct wl_list resource_list;
struct wl_surface *focus;
struct weston_touch {
- struct wl_seat *seat;
+ struct weston_seat *seat;
struct wl_list resource_list;
struct wl_surface *focus;
uint32_t grab_time;
};
-struct wl_seat {
- struct wl_list base_resource_list;
-
- struct weston_pointer *pointer;
- struct weston_keyboard *keyboard;
- struct weston_touch *touch;
-
- uint32_t selection_serial;
- struct wl_data_source *selection_data_source;
- struct wl_listener selection_data_source_listener;
- struct wl_signal selection_signal;
-
- struct wl_list drag_resource_list;
- struct wl_client *drag_client;
- struct wl_data_source *drag_data_source;
- struct wl_listener drag_data_source_listener;
- struct wl_surface *drag_focus;
- struct wl_resource *drag_focus_resource;
- struct wl_listener drag_focus_listener;
- struct weston_pointer_grab drag_grab;
- struct wl_surface *drag_surface;
- struct wl_listener drag_icon_listener;
- struct wl_signal drag_icon_signal;
-};
-
void
-wl_seat_set_pointer(struct wl_seat *seat, struct weston_pointer *pointer);
+weston_seat_set_pointer(struct weston_seat *seat, struct weston_pointer *pointer);
void
-wl_seat_set_keyboard(struct wl_seat *seat, struct weston_keyboard *keyboard);
+weston_seat_set_keyboard(struct weston_seat *seat, struct weston_keyboard *keyboard);
void
-wl_seat_set_touch(struct wl_seat *seat, struct weston_touch *touch);
+weston_seat_set_touch(struct weston_seat *seat, struct weston_touch *touch);
void
weston_pointer_init(struct weston_pointer *pointer);
weston_touch_end_grab(struct weston_touch *touch);
void
-wl_data_device_set_keyboard_focus(struct wl_seat *seat);
+wl_data_device_set_keyboard_focus(struct weston_seat *seat);
int
wl_data_device_manager_init(struct wl_display *display);
void
-wl_seat_set_selection(struct wl_seat *seat,
- struct wl_data_source *source, uint32_t serial);
+weston_seat_set_selection(struct weston_seat *seat,
+ struct wl_data_source *source, uint32_t serial);
struct weston_xkb_info {
struct xkb_keymap *keymap;
};
struct weston_keyboard {
- struct wl_seat *seat;
+ struct weston_seat *seat;
struct wl_list resource_list;
struct wl_surface *focus;
};
struct weston_seat {
- struct wl_seat seat;
- struct weston_pointer pointer;
+ struct wl_list base_resource_list;
+
+ struct weston_pointer *pointer;
+ struct weston_keyboard *keyboard;
+ struct weston_touch *touch;
+
+ struct weston_pointer pointer_instance;
int has_pointer;
- struct weston_keyboard keyboard;
+ struct weston_keyboard keyboard_instance;
int has_keyboard;
- struct weston_touch touch;
+ struct weston_touch touch_instance;
int has_touch;
struct wl_signal destroy_signal;
struct weston_compositor *compositor;
struct weston_surface *sprite;
struct wl_listener sprite_destroy_listener;
- struct weston_surface *drag_surface;
- struct wl_listener drag_surface_destroy_listener;
int32_t hotspot_x, hotspot_y;
struct wl_list link;
enum weston_keyboard_modifier modifier_state;
struct wl_surface *saved_kbd_focus;
struct wl_listener saved_kbd_focus_listener;
+ uint32_t selection_serial;
+ struct wl_data_source *selection_data_source;
+ struct wl_listener selection_data_source_listener;
+ struct wl_signal selection_signal;
+
+ struct wl_list drag_resource_list;
+ struct wl_client *drag_client;
+ struct wl_data_source *drag_data_source;
+ struct wl_listener drag_data_source_listener;
+ struct wl_surface *drag_focus;
+ struct wl_resource *drag_focus_resource;
+ struct wl_listener drag_focus_listener;
+ struct weston_pointer_grab drag_grab;
+ struct wl_surface *next_drag_surface;
+ struct weston_surface *drag_surface;
+ struct wl_listener drag_surface_destroy_listener;
+ struct wl_listener drag_icon_listener;
+ struct wl_signal drag_icon_signal;
+
uint32_t num_tp;
struct wl_listener new_drag_icon_listener;
struct weston_binding;
-typedef void (*weston_key_binding_handler_t)(struct wl_seat *seat,
+typedef void (*weston_key_binding_handler_t)(struct weston_seat *seat,
uint32_t time, uint32_t key,
void *data);
struct weston_binding *
weston_key_binding_handler_t binding,
void *data);
-typedef void (*weston_button_binding_handler_t)(struct wl_seat *seat,
+typedef void (*weston_button_binding_handler_t)(struct weston_seat *seat,
uint32_t time, uint32_t button,
void *data);
struct weston_binding *
weston_button_binding_handler_t binding,
void *data);
-typedef void (*weston_axis_binding_handler_t)(struct wl_seat *seat,
+typedef void (*weston_axis_binding_handler_t)(struct weston_seat *seat,
uint32_t time, uint32_t axis,
wl_fixed_t value, void *data);
struct weston_binding *
static void
destroy_drag_focus(struct wl_listener *listener, void *data)
{
- struct wl_seat *seat =
- container_of(listener, struct wl_seat, drag_focus_listener);
+ struct weston_seat *seat =
+ container_of(listener, struct weston_seat, drag_focus_listener);
seat->drag_focus_resource = NULL;
}
drag_grab_focus(struct weston_pointer_grab *grab,
struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
{
- struct wl_seat *seat = container_of(grab, struct wl_seat, drag_grab);
+ struct weston_seat *seat =
+ container_of(grab, struct weston_seat, drag_grab);
struct wl_resource *resource, *offer = NULL;
struct wl_display *display;
uint32_t serial;
drag_grab_motion(struct weston_pointer_grab *grab,
uint32_t time, wl_fixed_t x, wl_fixed_t y)
{
- struct wl_seat *seat = container_of(grab, struct wl_seat, drag_grab);
+ struct weston_seat *seat =
+ container_of(grab, struct weston_seat, drag_grab);
if (seat->drag_focus_resource)
wl_data_device_send_motion(seat->drag_focus_resource,
}
static void
-data_device_end_drag_grab(struct wl_seat *seat)
+data_device_end_drag_grab(struct weston_seat *seat)
{
if (seat->drag_surface) {
seat->drag_surface = NULL;
drag_grab_button(struct weston_pointer_grab *grab,
uint32_t time, uint32_t button, uint32_t state_w)
{
- struct wl_seat *seat = container_of(grab, struct wl_seat, drag_grab);
+ struct weston_seat *seat =
+ container_of(grab, struct weston_seat, drag_grab);
enum wl_pointer_button_state state = state_w;
if (seat->drag_focus_resource &&
static void
destroy_data_device_source(struct wl_listener *listener, void *data)
{
- struct wl_seat *seat = container_of(listener, struct wl_seat,
- drag_data_source_listener);
+ struct weston_seat *seat = container_of(listener, struct weston_seat,
+ drag_data_source_listener);
data_device_end_drag_grab(seat);
}
static void
destroy_data_device_icon(struct wl_listener *listener, void *data)
{
- struct wl_seat *seat = container_of(listener, struct wl_seat,
- drag_icon_listener);
+ struct weston_seat *seat = container_of(listener, struct weston_seat,
+ drag_icon_listener);
- seat->drag_surface = NULL;
+ seat->next_drag_surface = NULL;
}
static void
struct wl_resource *origin_resource,
struct wl_resource *icon_resource, uint32_t serial)
{
- struct wl_seat *seat = resource->data;
+ struct weston_seat *seat = resource->data;
/* FIXME: Check that client has implicit grab on the origin
* surface that matches the given time. */
}
if (icon_resource) {
- seat->drag_surface = icon_resource->data;
+ seat->next_drag_surface = icon_resource->data;
seat->drag_icon_listener.notify = destroy_data_device_icon;
wl_signal_add(&icon_resource->destroy_signal,
&seat->drag_icon_listener);
static void
destroy_selection_data_source(struct wl_listener *listener, void *data)
{
- struct wl_seat *seat = container_of(listener, struct wl_seat,
- selection_data_source_listener);
+ struct weston_seat *seat = container_of(listener, struct weston_seat,
+ selection_data_source_listener);
struct wl_resource *data_device;
struct wl_resource *focus = NULL;
}
WL_EXPORT void
-wl_seat_set_selection(struct wl_seat *seat, struct wl_data_source *source,
- uint32_t serial)
+weston_seat_set_selection(struct weston_seat *seat,
+ struct wl_data_source *source, uint32_t serial)
{
struct wl_resource *data_device, *offer;
struct wl_resource *focus = NULL;
return;
/* FIXME: Store serial and check against incoming serial here. */
- wl_seat_set_selection(resource->data, source_resource->data,
- serial);
+ weston_seat_set_selection(resource->data, source_resource->data,
+ serial);
}
static const struct wl_data_device_interface data_device_interface = {
struct wl_resource *manager_resource,
uint32_t id, struct wl_resource *seat_resource)
{
- struct wl_seat *seat = seat_resource->data;
+ struct weston_seat *seat = seat_resource->data;
struct wl_resource *resource;
resource = wl_client_add_object(client, &wl_data_device_interface,
}
WL_EXPORT void
-wl_data_device_set_keyboard_focus(struct wl_seat *seat)
+wl_data_device_set_keyboard_focus(struct weston_seat *seat)
{
struct wl_resource *data_device, *focus, *offer;
struct wl_data_source *source;
uint32_t *k;
int ret;
- if (!seat->seat.keyboard)
+ if (!seat->keyboard)
return;
memset(all_keys, 0, sizeof all_keys);
}
static void
-fragment_debug_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+fragment_debug_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct weston_compositor *ec = data;
{
const struct weston_pointer_grab_interface *interface;
struct weston_surface *surface, *focus;
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
if (!pointer)
return;
}
static void
-seat_send_updated_caps(struct wl_seat *seat)
+seat_send_updated_caps(struct weston_seat *seat)
{
struct wl_resource *r;
enum wl_seat_capability caps = 0;
}
WL_EXPORT void
-wl_seat_set_pointer(struct wl_seat *seat, struct weston_pointer *pointer)
+weston_seat_set_pointer(struct weston_seat *seat,
+ struct weston_pointer *pointer)
{
if (pointer && (seat->pointer || pointer->seat))
return; /* XXX: error? */
}
WL_EXPORT void
-wl_seat_set_keyboard(struct wl_seat *seat, struct weston_keyboard *keyboard)
+weston_seat_set_keyboard(struct weston_seat *seat,
+ struct weston_keyboard *keyboard)
{
if (keyboard && (seat->keyboard || keyboard->seat))
return; /* XXX: error? */
}
WL_EXPORT void
-wl_seat_set_touch(struct wl_seat *seat, struct weston_touch *touch)
+weston_seat_set_touch(struct weston_seat *seat, struct weston_touch *touch)
{
if (touch && (seat->touch || touch->seat))
return; /* XXX: error? */
x = wl_fixed_to_int(*fx);
y = wl_fixed_to_int(*fy);
- old_x = wl_fixed_to_int(seat->seat.pointer->x);
- old_y = wl_fixed_to_int(seat->seat.pointer->y);
+ old_x = wl_fixed_to_int(seat->pointer->x);
+ old_y = wl_fixed_to_int(seat->pointer->y);
wl_list_for_each(output, &ec->output_list, link) {
if (pixman_region32_contains_point(&output->region,
move_pointer(struct weston_seat *seat, wl_fixed_t x, wl_fixed_t y)
{
struct weston_compositor *ec = seat->compositor;
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
struct weston_output *output;
int32_t ix, iy;
{
const struct weston_pointer_grab_interface *interface;
struct weston_compositor *ec = seat->compositor;
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
weston_compositor_wake(ec);
{
const struct weston_pointer_grab_interface *interface;
struct weston_compositor *ec = seat->compositor;
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
weston_compositor_wake(ec);
{
struct weston_compositor *compositor = seat->compositor;
- if (seat->seat.keyboard) {
- weston_keyboard_set_focus(seat->seat.keyboard, &surface->surface);
- wl_data_device_set_keyboard_focus(&seat->seat);
+ if (seat->keyboard) {
+ weston_keyboard_set_focus(seat->keyboard, &surface->surface);
+ wl_data_device_set_keyboard_focus(seat);
}
wl_signal_emit(&compositor->activate_signal, surface);
enum wl_pointer_button_state state)
{
struct weston_compositor *compositor = seat->compositor;
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
struct weston_surface *focus =
(struct weston_surface *) pointer->focus;
uint32_t serial = wl_display_next_serial(compositor->wl_display);
wl_fixed_t value)
{
struct weston_compositor *compositor = seat->compositor;
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
struct weston_surface *focus =
(struct weston_surface *) pointer->focus;
uint32_t serial = wl_display_next_serial(compositor->wl_display);
WL_EXPORT void
notify_modifiers(struct weston_seat *seat, uint32_t serial)
{
- struct weston_keyboard *keyboard = &seat->keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
struct weston_keyboard_grab *grab = keyboard->grab;
uint32_t mods_depressed, mods_latched, mods_locked, group;
uint32_t mods_lookup;
group = xkb_state_serialize_group(seat->xkb_state.state,
XKB_STATE_EFFECTIVE);
- if (mods_depressed != seat->seat.keyboard->modifiers.mods_depressed ||
- mods_latched != seat->seat.keyboard->modifiers.mods_latched ||
- mods_locked != seat->seat.keyboard->modifiers.mods_locked ||
- group != seat->seat.keyboard->modifiers.group)
+ if (mods_depressed != seat->keyboard->modifiers.mods_depressed ||
+ mods_latched != seat->keyboard->modifiers.mods_latched ||
+ mods_locked != seat->keyboard->modifiers.mods_locked ||
+ group != seat->keyboard->modifiers.group)
changed = 1;
- seat->seat.keyboard->modifiers.mods_depressed = mods_depressed;
- seat->seat.keyboard->modifiers.mods_latched = mods_latched;
- seat->seat.keyboard->modifiers.mods_locked = mods_locked;
- seat->seat.keyboard->modifiers.group = group;
+ seat->keyboard->modifiers.mods_depressed = mods_depressed;
+ seat->keyboard->modifiers.mods_latched = mods_latched;
+ seat->keyboard->modifiers.mods_locked = mods_locked;
+ seat->keyboard->modifiers.group = group;
/* And update the modifier_state for bindings. */
mods_lookup = mods_depressed | mods_latched;
enum weston_key_state_update update_state)
{
struct weston_compositor *compositor = seat->compositor;
- struct weston_keyboard *keyboard = &seat->keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
struct weston_surface *focus =
(struct weston_surface *) keyboard->focus;
struct weston_keyboard_grab *grab = keyboard->grab;
enum weston_key_state_update update_state)
{
struct weston_compositor *compositor = seat->compositor;
- struct weston_keyboard *keyboard = seat->seat.keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
struct wl_surface *surface;
uint32_t *k, serial;
notify_keyboard_focus_out(struct weston_seat *seat)
{
struct weston_compositor *compositor = seat->compositor;
- struct weston_keyboard *keyboard = seat->seat.keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
uint32_t *k, serial;
serial = wl_display_next_serial(compositor->wl_display);
}
static void
-touch_set_focus(struct weston_seat *ws, struct wl_surface *surface)
+touch_set_focus(struct weston_seat *seat, struct wl_surface *surface)
{
- struct wl_seat *seat = &ws->seat;
struct wl_resource *resource;
if (seat->touch->focus == surface)
wl_fixed_t x, wl_fixed_t y, int touch_type)
{
struct weston_compositor *ec = seat->compositor;
- struct weston_touch *touch = seat->seat.touch;
+ struct weston_touch *touch = seat->touch;
struct weston_touch_grab *grab = touch->grab;
struct weston_surface *es;
wl_fixed_t sx, sy;
seat->hotspot_x -= dx;
seat->hotspot_y -= dy;
- x = wl_fixed_to_int(seat->seat.pointer->x) - seat->hotspot_x;
- y = wl_fixed_to_int(seat->seat.pointer->y) - seat->hotspot_y;
+ x = wl_fixed_to_int(seat->pointer->x) - seat->hotspot_x;
+ y = wl_fixed_to_int(seat->pointer->y) - seat->hotspot_y;
weston_surface_configure(seat->sprite, x, y,
width, height);
if (surface_resource)
surface = surface_resource->data;
- if (seat->seat.pointer->focus == NULL)
+ if (seat->pointer->focus == NULL)
return;
- if (seat->seat.pointer->focus->resource.client != client)
+ if (seat->pointer->focus->resource.client != client)
return;
- if (seat->seat.pointer->focus_serial - serial > UINT32_MAX / 2)
+ if (seat->pointer->focus_serial - serial > UINT32_MAX / 2)
return;
if (surface && surface != seat->sprite) {
struct weston_seat *seat = resource->data;
struct wl_resource *cr;
- if (!seat->seat.pointer)
+ if (!seat->pointer)
return;
cr = wl_client_add_object(client, &wl_pointer_interface,
&pointer_interface, id, seat);
- wl_list_insert(&seat->seat.pointer->resource_list, &cr->link);
+ wl_list_insert(&seat->pointer->resource_list, &cr->link);
cr->destroy = unbind_resource;
- if (seat->seat.pointer->focus &&
- seat->seat.pointer->focus->resource.client == client) {
+ if (seat->pointer->focus &&
+ seat->pointer->focus->resource.client == client) {
struct weston_surface *surface;
wl_fixed_t sx, sy;
- surface = (struct weston_surface *) seat->seat.pointer->focus;
+ surface = (struct weston_surface *) seat->pointer->focus;
weston_surface_from_global_fixed(surface,
- seat->seat.pointer->x,
- seat->seat.pointer->y,
+ seat->pointer->x,
+ seat->pointer->y,
&sx,
&sy);
- weston_pointer_set_focus(seat->seat.pointer,
- seat->seat.pointer->focus,
+ weston_pointer_set_focus(seat->pointer,
+ seat->pointer->focus,
sx,
sy);
}
struct weston_seat *seat = resource->data;
struct wl_resource *cr;
- if (!seat->seat.keyboard)
+ if (!seat->keyboard)
return;
cr = wl_client_add_object(client, &wl_keyboard_interface, NULL, id,
seat);
- wl_list_insert(&seat->seat.keyboard->resource_list, &cr->link);
+ wl_list_insert(&seat->keyboard->resource_list, &cr->link);
cr->destroy = unbind_resource;
wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
seat->xkb_info.keymap_fd,
seat->xkb_info.keymap_size);
- if (seat->seat.keyboard->focus &&
- seat->seat.keyboard->focus->resource.client == client) {
- weston_keyboard_set_focus(seat->seat.keyboard,
- seat->seat.keyboard->focus);
- wl_data_device_set_keyboard_focus(&seat->seat);
+ if (seat->keyboard->focus &&
+ seat->keyboard->focus->resource.client == client) {
+ weston_keyboard_set_focus(seat->keyboard,
+ seat->keyboard->focus);
+ wl_data_device_set_keyboard_focus(seat);
}
}
struct weston_seat *seat = resource->data;
struct wl_resource *cr;
- if (!seat->seat.touch)
+ if (!seat->touch)
return;
cr = wl_client_add_object(client, &wl_touch_interface, NULL, id, seat);
- wl_list_insert(&seat->seat.touch->resource_list, &cr->link);
+ wl_list_insert(&seat->touch->resource_list, &cr->link);
cr->destroy = unbind_resource;
}
static void
bind_seat(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
- struct wl_seat *seat = data;
+ struct weston_seat *seat = data;
struct wl_resource *resource;
enum wl_seat_capability caps = 0;
seat->xkb_state.leds = 0;
- weston_keyboard_init(&seat->keyboard);
- wl_seat_set_keyboard(&seat->seat, &seat->keyboard);
+ weston_keyboard_init(&seat->keyboard_instance);
+ weston_seat_set_keyboard(seat, &seat->keyboard_instance);
seat->has_keyboard = 1;
if (seat->has_pointer)
return;
- weston_pointer_init(&seat->pointer);
- wl_seat_set_pointer(&seat->seat, &seat->pointer);
+ weston_pointer_init(&seat->pointer_instance);
+ weston_seat_set_pointer(seat, &seat->pointer_instance);
seat->has_pointer = 1;
}
if (seat->has_touch)
return;
- weston_touch_init(&seat->touch);
- wl_seat_set_touch(&seat->seat, &seat->touch);
+ weston_touch_init(&seat->touch_instance);
+ weston_seat_set_touch(seat, &seat->touch_instance);
seat->has_touch = 1;
}
{
memset(seat, 0, sizeof *seat);
- seat->seat.selection_data_source = NULL;
- wl_list_init(&seat->seat.base_resource_list);
- wl_signal_init(&seat->seat.selection_signal);
- wl_list_init(&seat->seat.drag_resource_list);
- wl_signal_init(&seat->seat.drag_icon_signal);
+ seat->selection_data_source = NULL;
+ wl_list_init(&seat->base_resource_list);
+ wl_signal_init(&seat->selection_signal);
+ wl_list_init(&seat->drag_resource_list);
+ wl_signal_init(&seat->drag_icon_signal);
+ wl_signal_init(&seat->destroy_signal);
seat->has_pointer = 0;
seat->has_keyboard = 0;
wl_list_insert(ec->seat_list.prev, &seat->link);
seat->new_drag_icon_listener.notify = device_handle_new_drag_icon;
- wl_signal_add(&seat->seat.drag_icon_signal,
+ wl_signal_add(&seat->drag_icon_signal,
&seat->new_drag_icon_listener);
clipboard_create(seat);
- wl_signal_init(&seat->destroy_signal);
wl_signal_emit(&ec->seat_created_signal, seat);
}
xkb_state_unref(seat->xkb_state.state);
xkb_info_destroy(&seat->xkb_info);
- if (seat->seat.pointer)
- weston_pointer_release(seat->seat.pointer);
- if (seat->seat.keyboard)
- weston_keyboard_release(seat->seat.keyboard);
- if (seat->seat.touch)
- weston_touch_release(seat->seat.touch);
+ if (seat->pointer)
+ weston_pointer_release(seat->pointer);
+ if (seat->keyboard)
+ weston_keyboard_release(seat->keyboard);
+ if (seat->touch)
+ weston_touch_release(seat->touch);
wl_signal_emit(&seat->destroy_signal, seat);
}
}
static int
-device_setup_new_drag_surface(struct weston_seat *ws,
+device_setup_new_drag_surface(struct weston_seat *seat,
struct weston_surface *surface)
{
- struct wl_seat *seat = &ws->seat;
-
if (surface->configure) {
wl_resource_post_error(&surface->surface.resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return 0;
}
- ws->drag_surface = surface;
+ seat->drag_surface = surface;
- weston_surface_set_position(ws->drag_surface,
+ weston_surface_set_position(seat->drag_surface,
wl_fixed_to_double(seat->pointer->x),
wl_fixed_to_double(seat->pointer->y));
surface->configure = drag_surface_configure;
wl_signal_add(&surface->surface.resource.destroy_signal,
- &ws->drag_surface_destroy_listener);
+ &seat->drag_surface_destroy_listener);
return 1;
}
}
static void
-weston_seat_update_drag_surface(struct weston_seat *seat,
- int dx, int dy)
+weston_seat_update_drag_surface(struct weston_seat *seat, int dx, int dy)
{
int surface_changed = 0;
- if (!seat->drag_surface && !seat->seat.drag_surface)
+ if (!seat->drag_surface && !seat->drag_surface)
return;
- if (seat->drag_surface && seat->seat.drag_surface &&
+ if (seat->drag_surface && seat->drag_surface &&
(&seat->drag_surface->surface.resource !=
- &seat->seat.drag_surface->resource))
+ &seat->next_drag_surface->resource))
/* between calls to this funcion we got a new drag_surface */
surface_changed = 1;
- if (!seat->seat.drag_surface || surface_changed) {
+ if (!seat->drag_surface || surface_changed) {
device_release_drag_surface(seat);
if (!surface_changed)
return;
}
if (!seat->drag_surface || surface_changed) {
- struct weston_surface *surface = (struct weston_surface *)
- seat->seat.drag_surface;
+ struct weston_surface *surface =
+ (struct weston_surface *) seat->drag_surface;
if (!device_setup_new_drag_surface(seat, surface))
return;
}
}
static void
-debug_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+debug_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct weston_compositor *ec = data;
}
static void
-screenshooter_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+screenshooter_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct screenshooter *shooter = data;
}
static void
-recorder_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+recorder_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct weston_seat *ws = (struct weston_seat *) seat;
struct weston_compositor *ec = ws->compositor;
shell_surface_get_shell(struct shell_surface *shsurf);
static void
-surface_rotate(struct shell_surface *surface, struct wl_seat *seat);
+surface_rotate(struct shell_surface *surface, struct weston_seat *seat);
static bool
shell_surface_is_top_fullscreen(struct shell_surface *shsurf)
surface = state->keyboard_focus ?
&state->keyboard_focus->surface : NULL;
- weston_keyboard_set_focus(state->seat->seat.keyboard, surface);
+ weston_keyboard_set_focus(state->seat->keyboard, surface);
}
}
wl_list_for_each(state, &ws->focus_list, link) {
if (state->seat == seat) {
- surface = seat->seat.keyboard->focus;
+ surface = seat->keyboard->focus;
state->keyboard_focus =
(struct weston_surface *) surface;
return;
drop_focus_state(shell, from, surface);
wl_list_for_each(seat, &shell->compositor->seat_list, link)
if (seat->has_keyboard &&
- seat->keyboard.focus == &surface->surface)
- weston_keyboard_set_focus(&seat->keyboard, NULL);
+ seat->keyboard->focus == &surface->surface)
+ weston_keyboard_set_focus(seat->keyboard, NULL);
weston_surface_damage_below(surface);
}
static void
take_surface_to_workspace_by_seat(struct desktop_shell *shell,
- struct wl_seat *wl_seat,
+ struct weston_seat *seat,
unsigned int index)
{
- struct weston_seat *seat = (struct weston_seat *) wl_seat;
struct weston_surface *surface =
- (struct weston_surface *) wl_seat->keyboard->focus;
+ (struct weston_surface *) seat->keyboard->focus;
struct shell_surface *shsurf;
struct workspace *from;
struct workspace *to;
};
static int
-surface_move(struct shell_surface *shsurf, struct weston_seat *ws)
+surface_move(struct shell_surface *shsurf, struct weston_seat *seat)
{
struct weston_move_grab *move;
return -1;
move->dx = wl_fixed_from_double(shsurf->surface->geometry.x) -
- ws->seat.pointer->grab_x;
+ seat->pointer->grab_x;
move->dy = wl_fixed_from_double(shsurf->surface->geometry.y) -
- ws->seat.pointer->grab_y;
+ seat->pointer->grab_y;
shell_grab_start(&move->base, &move_grab_interface, shsurf,
- ws->seat.pointer, DESKTOP_SHELL_CURSOR_MOVE);
+ seat->pointer, DESKTOP_SHELL_CURSOR_MOVE);
return 0;
}
shell_surface_move(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *seat_resource, uint32_t serial)
{
- struct weston_seat *ws = seat_resource->data;
+ struct weston_seat *seat = seat_resource->data;
struct shell_surface *shsurf = resource->data;
- if (ws->seat.pointer->button_count == 0 ||
- ws->seat.pointer->grab_serial != serial ||
- ws->seat.pointer->focus != &shsurf->surface->surface)
+ if (seat->pointer->button_count == 0 ||
+ seat->pointer->grab_serial != serial ||
+ seat->pointer->focus != &shsurf->surface->surface)
return;
- if (surface_move(shsurf, ws) < 0)
+ if (surface_move(shsurf, seat) < 0)
wl_resource_post_no_memory(resource);
}
static int
surface_resize(struct shell_surface *shsurf,
- struct weston_seat *ws, uint32_t edges)
+ struct weston_seat *seat, uint32_t edges)
{
struct weston_resize_grab *resize;
resize->height = shsurf->surface->geometry.height;
shell_grab_start(&resize->base, &resize_grab_interface, shsurf,
- ws->seat.pointer, edges);
+ seat->pointer, edges);
return 0;
}
struct wl_resource *seat_resource, uint32_t serial,
uint32_t edges)
{
- struct weston_seat *ws = seat_resource->data;
+ struct weston_seat *seat = seat_resource->data;
struct shell_surface *shsurf = resource->data;
if (shsurf->type == SHELL_SURFACE_FULLSCREEN)
return;
- if (ws->seat.pointer->button_count == 0 ||
- ws->seat.pointer->grab_serial != serial ||
- ws->seat.pointer->focus != &shsurf->surface->surface)
+ if (seat->pointer->button_count == 0 ||
+ seat->pointer->grab_serial != serial ||
+ seat->pointer->focus != &shsurf->surface->surface)
return;
- if (surface_resize(shsurf, ws, edges) < 0)
+ if (surface_resize(shsurf, seat, edges) < 0)
wl_resource_post_no_memory(resource);
}
struct shell_surface *shsurf;
struct weston_surface *surface =
(struct weston_surface *) grab->grab.pointer->current;
- struct weston_seat *seat =
- (struct weston_seat *) grab->grab.pointer->seat;
+ struct weston_seat *seat = grab->grab.pointer->seat;
shsurf = get_shell_surface(surface);
if (shsurf && button == BTN_LEFT && state) {
surface_move(shsurf, seat);
} else if (shsurf && button == BTN_RIGHT && state) {
activate(shsurf->shell, shsurf->surface, seat);
- surface_rotate(shsurf, &seat->seat);
+ surface_rotate(shsurf, seat);
}
}
shsurf->unresponsive = 1;
wl_list_for_each(seat, &shsurf->surface->compositor->seat_list, link)
- if (seat->seat.pointer->focus == &shsurf->surface->surface)
- set_busy_cursor(shsurf, seat->seat.pointer);
+ if (seat->pointer->focus == &shsurf->surface->surface)
+ set_busy_cursor(shsurf, seat->pointer);
return 1;
}
{
struct wl_listener *listener;
- if (!seat->seat.pointer)
+ if (!seat->pointer)
return;
listener = malloc(sizeof *listener);
listener->notify = handle_pointer_focus;
- wl_signal_add(&seat->seat.pointer->focus_signal, listener);
+ wl_signal_add(&seat->pointer->focus_signal, listener);
}
static void
if (was_unresponsive) {
/* Received pong from previously unresponsive client */
wl_list_for_each(seat, &ec->seat_list, link) {
- pointer = seat->seat.pointer;
+ pointer = seat->pointer;
if (pointer->focus ==
&shell->grab_surface->surface &&
pointer->current ==
wl_pointer_send_button(resource, serial, time, button, state);
} else if (state == WL_POINTER_BUTTON_STATE_RELEASED &&
(shseat->popup_grab.initial_up ||
- time - shseat->seat->pointer.grab_time > 500)) {
+ time - shseat->seat->pointer->grab_time > 500)) {
popup_grab_end(grab->pointer);
}
static void
add_popup_grab(struct shell_surface *shsurf, struct shell_seat *shseat)
{
- struct wl_seat *seat = &shseat->seat->seat;
+ struct weston_seat *seat = shseat->seat;
if (wl_list_empty(&shseat->popup_grab.surfaces_list)) {
shseat->popup_grab.client = shsurf->surface->surface.resource.client;
/* We must make sure here that this popup was opened after
* a mouse press, and not just by moving around with other
* popups already open. */
- if (shseat->seat->pointer.button_count > 0)
+ if (shseat->seat->pointer->button_count > 0)
shseat->popup_grab.initial_up = 0;
weston_pointer_start_grab(seat->pointer, &shseat->popup_grab.grab);
weston_surface_set_position(es, shsurf->popup.x, shsurf->popup.y);
weston_surface_update_transform(es);
- if (shseat->seat->pointer.grab_serial == shsurf->popup.serial) {
+ if (shseat->seat->pointer->grab_serial == shsurf->popup.serial) {
add_popup_grab(shsurf, shseat);
} else {
wl_shell_surface_send_popup_done(&shsurf->resource);
}
static void
-move_binding(struct wl_seat *seat, uint32_t time, uint32_t button, void *data)
+move_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
{
struct weston_surface *surface =
(struct weston_surface *) seat->pointer->focus;
}
static void
-resize_binding(struct wl_seat *seat, uint32_t time, uint32_t button, void *data)
+resize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
{
struct weston_surface *surface =
(struct weston_surface *) seat->pointer->focus;
}
static void
-surface_opacity_binding(struct wl_seat *seat, uint32_t time, uint32_t axis,
+surface_opacity_binding(struct weston_seat *seat, uint32_t time, uint32_t axis,
wl_fixed_t value, void *data)
{
float step = 0.005;
}
static void
-do_zoom(struct wl_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
+do_zoom(struct weston_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
wl_fixed_t value)
{
struct weston_seat *ws = (struct weston_seat *) seat;
}
static void
-zoom_axis_binding(struct wl_seat *seat, uint32_t time, uint32_t axis,
+zoom_axis_binding(struct weston_seat *seat, uint32_t time, uint32_t axis,
wl_fixed_t value, void *data)
{
do_zoom(seat, time, 0, axis, value);
}
static void
-zoom_key_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+zoom_key_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
do_zoom(seat, time, key, 0, 0);
}
static void
-terminate_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+terminate_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct weston_compositor *compositor = data;
};
static void
-surface_rotate(struct shell_surface *surface, struct wl_seat *seat)
+surface_rotate(struct shell_surface *surface, struct weston_seat *seat)
{
struct rotate_grab *rotate;
float dx, dy;
}
static void
-rotate_binding(struct wl_seat *seat, uint32_t time, uint32_t button,
+rotate_binding(struct weston_seat *seat, uint32_t time, uint32_t button,
void *data)
{
struct weston_surface *base_surface =
}
static void
-click_to_activate_binding(struct wl_seat *seat, uint32_t time, uint32_t button,
+click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t button,
void *data)
{
struct weston_seat *ws = (struct weston_seat *) seat;
*/
wl_list_for_each(seat, &compositor->seat_list, link) {
if (seat->has_pointer) {
- ix = wl_fixed_to_int(seat->pointer.x);
- iy = wl_fixed_to_int(seat->pointer.y);
+ ix = wl_fixed_to_int(seat->pointer->x);
+ iy = wl_fixed_to_int(seat->pointer->y);
break;
}
}
};
static void
-switcher_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+switcher_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct desktop_shell *shell = data;
}
static void
-backlight_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+backlight_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct weston_compositor *compositor = data;
}
static void
-fan_debug_repaint_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+fan_debug_repaint_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct desktop_shell *shell = data;
};
static void
-debug_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+debug_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct debug_binding_grab *grab;
}
static void
-force_kill_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
+force_kill_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
struct wl_surface *focus_surface;
}
static void
-workspace_up_binding(struct wl_seat *seat, uint32_t time,
+workspace_up_binding(struct weston_seat *seat, uint32_t time,
uint32_t key, void *data)
{
struct desktop_shell *shell = data;
}
static void
-workspace_down_binding(struct wl_seat *seat, uint32_t time,
+workspace_down_binding(struct weston_seat *seat, uint32_t time,
uint32_t key, void *data)
{
struct desktop_shell *shell = data;
}
static void
-workspace_f_binding(struct wl_seat *seat, uint32_t time,
+workspace_f_binding(struct weston_seat *seat, uint32_t time,
uint32_t key, void *data)
{
struct desktop_shell *shell = data;
}
static void
-workspace_move_surface_up_binding(struct wl_seat *seat, uint32_t time,
+workspace_move_surface_up_binding(struct weston_seat *seat, uint32_t time,
uint32_t key, void *data)
{
struct desktop_shell *shell = data;
}
static void
-workspace_move_surface_down_binding(struct wl_seat *seat, uint32_t time,
+workspace_move_surface_down_binding(struct weston_seat *seat, uint32_t time,
uint32_t key, void *data)
{
struct desktop_shell *shell = data;
}
static void
-menu_key_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+menu_key_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct tablet_shell *shell = data;
}
static void
-home_key_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
+home_key_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{
struct tablet_shell *shell = data;
struct input_method_context *context = resource->data;
struct wl_resource *cr;
struct weston_seat *seat = context->input_method->seat;
- struct weston_keyboard *keyboard = &seat->keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
cr = wl_client_add_object(client, &wl_keyboard_interface,
NULL, id, context);
{
struct input_method_context *context = resource->data;
struct weston_seat *seat = context->input_method->seat;
- struct weston_keyboard *keyboard = seat->seat.keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
struct weston_keyboard_grab *default_grab = &keyboard->default_grab;
default_grab->interface->key(default_grab, time, key, state_w);
struct input_method_context *context = resource->data;
struct weston_seat *seat = context->input_method->seat;
- struct weston_keyboard *keyboard = seat->seat.keyboard;
+ struct weston_keyboard *keyboard = seat->keyboard;
struct weston_keyboard_grab *default_grab = &keyboard->default_grab;
default_grab->interface->modifiers(default_grab,
static void
input_method_context_end_keyboard_grab(struct input_method_context *context)
{
- struct weston_keyboard_grab *grab = &context->input_method->seat->keyboard.input_method_grab;
+ struct weston_keyboard_grab *grab =
+ &context->input_method->seat->keyboard->input_method_grab;
struct weston_keyboard *keyboard = grab->keyboard;
if (!grab->keyboard)
if (seat->has_keyboard) {
seat->input_method->keyboard_focus_listener.notify = handle_keyboard_focus;
- wl_signal_add(&seat->seat.keyboard->focus_signal, &seat->input_method->keyboard_focus_listener);
- seat->keyboard.input_method_grab.interface = &input_method_context_grab;
+ wl_signal_add(&seat->keyboard->focus_signal, &seat->input_method->keyboard_focus_listener);
+ seat->keyboard->input_method_grab.interface = &input_method_context_grab;
}
seat->input_method->focus_listener_initialized = 1;
wl_list_for_each_safe(device, next, &seat->devices_list, link)
evdev_device_destroy(device);
- if (seat->base.seat.keyboard)
+ if (seat->base.keyboard)
notify_keyboard_focus_out(&seat->base);
}
}
compositor = wm->server->compositor;
- wl_seat_set_selection(&seat->seat, &source->base,
- wl_display_next_serial(compositor->wl_display));
+ weston_seat_set_selection(seat, &source->base,
+ wl_display_next_serial(compositor->wl_display));
free(reply);
}
weston_wm_read_data_source,
wm);
- source = seat->seat.selection_data_source;
+ source = seat->selection_data_source;
source->send(source, mime_type, p[1]);
}
* proxy selection. Clear the wayland selection. */
compositor = wm->server->compositor;
serial = wl_display_next_serial(compositor->wl_display);
- wl_seat_set_selection(&seat->seat, NULL, serial);
+ weston_seat_set_selection(seat, NULL, serial);
}
wm->selection_owner = XCB_WINDOW_NONE;
static void
weston_wm_set_selection(struct wl_listener *listener, void *data)
{
- struct wl_seat *seat = data;
+ struct weston_seat *seat = data;
struct weston_wm *wm =
container_of(listener, struct weston_wm, selection_listener);
struct wl_data_source *source = seat->selection_data_source;
seat = weston_wm_pick_seat(wm);
wm->selection_listener.notify = weston_wm_set_selection;
- wl_signal_add(&seat->seat.selection_signal, &wm->selection_listener);
+ wl_signal_add(&seat->selection_signal, &wm->selection_listener);
weston_wm_set_selection(&wm->selection_listener, seat);
}
struct weston_shell_interface *shell_interface =
&wm->server->compositor->shell_interface;
- if (seat->seat.pointer->button_count != 1 ||
- seat->seat.pointer->focus != &window->surface->surface)
+ if (seat->pointer->button_count != 1 ||
+ seat->pointer->focus != &window->surface->surface)
return;
detail = client_message->data.data32[2];
output->zoom.spring_xy.current = output->zoom.spring_xy.target;
output->zoom.current.x =
output->zoom.type == ZOOM_FOCUS_POINTER ?
- seat->pointer.x : output->zoom.text_cursor.x;
+ seat->pointer->x : output->zoom.text_cursor.x;
output->zoom.current.y =
output->zoom.type == ZOOM_FOCUS_POINTER ?
- seat->pointer.y : output->zoom.text_cursor.y;
+ seat->pointer->y : output->zoom.text_cursor.y;
wl_list_remove(&animation->link);
wl_list_init(&animation->link);
}
weston_output_update_zoom(struct weston_output *output, uint32_t type)
{
struct weston_seat *seat = weston_zoom_pick_seat(output->compositor);
- wl_fixed_t x = seat->pointer.x;
- wl_fixed_t y = seat->pointer.y;
+ wl_fixed_t x = seat->pointer->x;
+ wl_fixed_t y = seat->pointer->y;
zoom_area_center_from_pointer(output, &x, &y);
if (type == ZOOM_FOCUS_POINTER) {
if (wl_list_empty(&output->zoom.animation_xy.link)) {
- output->zoom.current.x = seat->pointer.x;
- output->zoom.current.y = seat->pointer.y;
+ output->zoom.current.x = seat->pointer->x;
+ output->zoom.current.y = seat->pointer->y;
} else {
output->zoom.to.x = x;
output->zoom.to.y = y;
notify_pointer_position(struct weston_test *test, struct wl_resource *resource)
{
struct weston_seat *seat = get_seat(test);
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
wl_test_send_pointer_position(resource, pointer->x, pointer->y);
}
{
struct weston_test *test = resource->data;
struct weston_seat *seat = get_seat(test);
- struct weston_pointer *pointer = seat->seat.pointer;
+ struct weston_pointer *pointer = seat->pointer;
test->compositor->focus = 1;
if (surface) {
weston_surface_activate(surface, seat);
- notify_keyboard_focus_in(seat, &seat->keyboard.keys,
+ notify_keyboard_focus_in(seat, &seat->keyboard->keys,
STATE_UPDATE_AUTOMATIC);
}
else {