diff --git a/src/bindings.c b/src/bindings.c index 1fabc77d..e548ff13 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -194,8 +194,7 @@ static const struct weston_keyboard_grab_interface binding_grab = { }; 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; @@ -219,14 +218,14 @@ weston_compositor_run_key_binding(struct weston_compositor *compositor, 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); } } } @@ -245,7 +244,7 @@ weston_compositor_run_button_binding(struct weston_compositor *compositor, 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); } } } @@ -261,7 +260,7 @@ weston_compositor_run_axis_binding(struct weston_compositor *compositor, 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; } } @@ -285,7 +284,7 @@ weston_compositor_run_debug_binding(struct weston_compositor *compositor, count++; handler = binding->handler; - handler(&seat->seat, time, key, binding->data); + handler(seat, time, key, binding->data); } return count; diff --git a/src/clipboard.c b/src/clipboard.c index 7f8d93b2..11edc712 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -209,15 +209,15 @@ clipboard_set_selection(struct wl_listener *listener, void *data) 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. */ @@ -238,7 +238,7 @@ clipboard_set_selection(struct wl_listener *listener, void *data) 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; } @@ -268,7 +268,7 @@ clipboard_create(struct weston_seat *seat) 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); diff --git a/src/compositor-drm.c b/src/compositor-drm.c index f39096e4..ac61ef6b 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -2251,7 +2251,7 @@ vt_func(struct weston_compositor *compositor, int event) } 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; @@ -2315,7 +2315,7 @@ find_primary_gpu(struct drm_compositor *ec, const char *seat) } 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; diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c index 9d9eff5b..0f458585 100644 --- a/src/compositor-fbdev.c +++ b/src/compositor-fbdev.c @@ -826,7 +826,7 @@ fbdev_restore(struct weston_compositor *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 fbdev_compositor *ec = data; diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c index 0b3bab34..1e02aa12 100644 --- a/src/compositor-rpi.c +++ b/src/compositor-rpi.c @@ -1335,7 +1335,7 @@ evdev_remove_devices(struct weston_seat *seat_base) 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); } @@ -1426,7 +1426,7 @@ rpi_restore(struct weston_compositor *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; diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c index d9d7530c..44d234c0 100644 --- a/src/compositor-wayland.c +++ b/src/compositor-wayland.c @@ -451,9 +451,9 @@ input_handle_motion(void *data, struct wl_pointer *pointer, 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 diff --git a/src/compositor-x11.c b/src/compositor-x11.c index bb8e8925..e827cec0 100644 --- a/src/compositor-x11.c +++ b/src/compositor-x11.c @@ -865,7 +865,7 @@ 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, diff --git a/src/compositor.c b/src/compositor.c index 7abb6712..4dba3a33 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -122,7 +122,7 @@ weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode /* 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) @@ -946,12 +946,12 @@ weston_surface_unmap(struct weston_surface *surface) 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)); diff --git a/src/compositor.h b/src/compositor.h index 9512678d..e7611387 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -286,7 +286,7 @@ struct wl_data_source { }; struct weston_pointer { - struct wl_seat *seat; + struct weston_seat *seat; struct wl_list resource_list; struct wl_surface *focus; @@ -312,7 +312,7 @@ struct weston_pointer { struct weston_touch { - struct wl_seat *seat; + struct weston_seat *seat; struct wl_list resource_list; struct wl_surface *focus; @@ -328,37 +328,12 @@ struct weston_touch { 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); @@ -401,15 +376,15 @@ void 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; @@ -430,7 +405,7 @@ struct weston_xkb_info { }; struct weston_keyboard { - struct wl_seat *seat; + struct weston_seat *seat; struct wl_list resource_list; struct wl_surface *focus; @@ -459,26 +434,48 @@ struct weston_keyboard { }; 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; @@ -872,7 +869,7 @@ weston_compositor_pick_surface(struct weston_compositor *compositor, 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 * @@ -882,7 +879,7 @@ weston_compositor_add_key_binding(struct weston_compositor *compositor, 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 * @@ -892,7 +889,7 @@ weston_compositor_add_button_binding(struct weston_compositor *compositor, 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 * diff --git a/src/data-device.c b/src/data-device.c index 2a3eb99b..cd85860d 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -158,8 +158,8 @@ find_resource(struct wl_list *list, struct wl_client *client) 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; } @@ -168,7 +168,8 @@ static void 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; @@ -214,7 +215,8 @@ static void 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, @@ -222,7 +224,7 @@ drag_grab_motion(struct weston_pointer_grab *grab, } 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; @@ -243,7 +245,8 @@ static void 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 && @@ -268,8 +271,8 @@ static const struct weston_pointer_grab_interface drag_grab_interface = { 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); } @@ -277,10 +280,10 @@ destroy_data_device_source(struct wl_listener *listener, void *data) 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 @@ -289,7 +292,7 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource, 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. */ @@ -310,7 +313,7 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource, } 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); @@ -325,8 +328,8 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource, 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; @@ -345,8 +348,8 @@ destroy_selection_data_source(struct wl_listener *listener, void *data) } 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; @@ -397,8 +400,8 @@ data_device_set_selection(struct wl_client *client, 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 = { @@ -477,7 +480,7 @@ get_data_device(struct wl_client *client, 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, @@ -502,7 +505,7 @@ bind_manager(struct wl_client *client, } 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; diff --git a/src/evdev.c b/src/evdev.c index 2c81d2b1..9289b1cd 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -618,7 +618,7 @@ evdev_notify_keyboard_focus(struct weston_seat *seat, uint32_t *k; int ret; - if (!seat->seat.keyboard) + if (!seat->keyboard) return; memset(all_keys, 0, sizeof all_keys); diff --git a/src/gl-renderer.c b/src/gl-renderer.c index ea6631f1..9e3bbcd4 100644 --- a/src/gl-renderer.c +++ b/src/gl-renderer.c @@ -1860,7 +1860,7 @@ compile_shaders(struct weston_compositor *ec) } 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; diff --git a/src/input.c b/src/input.c index a8c9063c..5fa266d3 100644 --- a/src/input.c +++ b/src/input.c @@ -48,7 +48,7 @@ weston_seat_repick(struct weston_seat *seat) { 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; @@ -357,7 +357,7 @@ weston_touch_release(struct weston_touch *touch) } 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; @@ -374,7 +374,8 @@ seat_send_updated_caps(struct wl_seat *seat) } 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? */ @@ -389,7 +390,8 @@ wl_seat_set_pointer(struct wl_seat *seat, struct weston_pointer *pointer) } 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? */ @@ -404,7 +406,7 @@ wl_seat_set_keyboard(struct wl_seat *seat, struct weston_keyboard *keyboard) } 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? */ @@ -603,8 +605,8 @@ clip_pointer_motion(struct weston_seat *seat, wl_fixed_t *fx, wl_fixed_t *fy) 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, @@ -634,7 +636,7 @@ static void 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; @@ -670,7 +672,7 @@ notify_motion(struct weston_seat *seat, { 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); @@ -687,7 +689,7 @@ notify_motion_absolute(struct weston_seat *seat, { 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); @@ -704,9 +706,9 @@ weston_surface_activate(struct weston_surface *surface, { 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); @@ -717,7 +719,7 @@ notify_button(struct weston_seat *seat, uint32_t time, int32_t button, 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); @@ -753,7 +755,7 @@ notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis, 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); @@ -778,7 +780,7 @@ notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis, 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; @@ -796,16 +798,16 @@ notify_modifiers(struct weston_seat *seat, uint32_t serial) 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; @@ -867,7 +869,7 @@ notify_key(struct weston_seat *seat, uint32_t time, uint32_t key, 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; @@ -949,7 +951,7 @@ notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys, 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; @@ -981,7 +983,7 @@ WL_EXPORT void 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); @@ -1009,9 +1011,8 @@ notify_keyboard_focus_out(struct weston_seat *seat) } 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) @@ -1051,7 +1052,7 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, 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; @@ -1129,8 +1130,8 @@ pointer_cursor_surface_configure(struct weston_surface *es, 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); @@ -1167,11 +1168,11 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource, 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) { @@ -1226,27 +1227,27 @@ seat_get_pointer(struct wl_client *client, struct wl_resource *resource, 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); } @@ -1259,23 +1260,23 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource, 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); } } @@ -1286,11 +1287,11 @@ seat_get_touch(struct wl_client *client, struct wl_resource *resource, 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; } @@ -1303,7 +1304,7 @@ static const struct wl_seat_interface seat_interface = { 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; @@ -1492,8 +1493,8 @@ weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap) 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; @@ -1506,8 +1507,8 @@ weston_seat_init_pointer(struct weston_seat *seat) 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; } @@ -1518,8 +1519,8 @@ weston_seat_init_touch(struct weston_seat *seat) 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; } @@ -1529,11 +1530,12 @@ weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec) { 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; @@ -1557,12 +1559,11 @@ weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec) 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); } @@ -1579,12 +1580,12 @@ weston_seat_release(struct weston_seat *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); } @@ -1600,11 +1601,9 @@ drag_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy, int32_ } 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, @@ -1612,16 +1611,16 @@ device_setup_new_drag_surface(struct weston_seat *ws, 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; } @@ -1658,29 +1657,28 @@ device_map_drag_surface(struct weston_seat *seat) } 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; } diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c index 9dbe9f0f..60800bc2 100644 --- a/src/pixman-renderer.c +++ b/src/pixman-renderer.c @@ -456,7 +456,7 @@ pixman_renderer_destroy(struct weston_compositor *ec) } 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; diff --git a/src/screenshooter.c b/src/screenshooter.c index c8da3763..ae97b4ec 100644 --- a/src/screenshooter.c +++ b/src/screenshooter.c @@ -203,7 +203,7 @@ screenshooter_sigchld(struct weston_process *process, int status) } 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; @@ -452,7 +452,7 @@ weston_recorder_destroy(struct weston_recorder *recorder) } 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; diff --git a/src/shell.c b/src/shell.c index b7ee5765..3a927288 100644 --- a/src/shell.c +++ b/src/shell.c @@ -273,7 +273,7 @@ static struct desktop_shell * 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) @@ -504,7 +504,7 @@ restore_focus_state(struct desktop_shell *shell, struct workspace *ws) 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); } } @@ -517,7 +517,7 @@ replace_focus_state(struct desktop_shell *shell, struct workspace *ws, 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; @@ -901,20 +901,19 @@ move_surface_to_workspace(struct desktop_shell *shell, 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; @@ -1068,7 +1067,7 @@ static const struct weston_pointer_grab_interface move_grab_interface = { }; 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; @@ -1083,12 +1082,12 @@ surface_move(struct shell_surface *shsurf, struct weston_seat *ws) 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; } @@ -1097,15 +1096,15 @@ static void 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); } @@ -1190,7 +1189,7 @@ static const struct weston_pointer_grab_interface resize_grab_interface = { 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; @@ -1211,7 +1210,7 @@ surface_resize(struct shell_surface *shsurf, resize->height = shsurf->surface->geometry.height; shell_grab_start(&resize->base, &resize_grab_interface, shsurf, - ws->seat.pointer, edges); + seat->pointer, edges); return 0; } @@ -1221,18 +1220,18 @@ shell_surface_resize(struct wl_client *client, struct wl_resource *resource, 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); } @@ -1262,8 +1261,7 @@ busy_cursor_grab_button(struct weston_pointer_grab *base, 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) { @@ -1271,7 +1269,7 @@ busy_cursor_grab_button(struct weston_pointer_grab *base, 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); } } @@ -1328,8 +1326,8 @@ ping_timeout_handler(void *data) 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; } @@ -1393,12 +1391,12 @@ create_pointer_focus_listener(struct weston_seat *seat) { 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 @@ -1422,7 +1420,7 @@ shell_surface_pong(struct wl_client *client, struct wl_resource *resource, 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 == @@ -1969,7 +1967,7 @@ popup_grab_button(struct weston_pointer_grab *grab, 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); } @@ -2014,7 +2012,7 @@ popup_grab_end(struct weston_pointer *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; @@ -2022,7 +2020,7 @@ add_popup_grab(struct shell_surface *shsurf, struct shell_seat *shseat) /* 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); @@ -2056,7 +2054,7 @@ shell_map_popup(struct shell_surface *shsurf) 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); @@ -2518,7 +2516,7 @@ get_shell_surface_type(struct weston_surface *surface) } 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; @@ -2536,7 +2534,7 @@ move_binding(struct wl_seat *seat, uint32_t time, uint32_t button, void *data) } 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; @@ -2575,7 +2573,7 @@ resize_binding(struct wl_seat *seat, uint32_t time, uint32_t button, void *data) } 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; @@ -2602,7 +2600,7 @@ surface_opacity_binding(struct wl_seat *seat, uint32_t time, uint32_t axis, } 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; @@ -2645,21 +2643,21 @@ do_zoom(struct wl_seat *seat, uint32_t time, uint32_t key, uint32_t axis, } 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; @@ -2760,7 +2758,7 @@ static const struct weston_pointer_grab_interface rotate_grab_interface = { }; 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; @@ -2797,7 +2795,7 @@ surface_rotate(struct shell_surface *surface, struct wl_seat *seat) } 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 = @@ -2877,7 +2875,7 @@ is_black_surface (struct weston_surface *es, struct weston_surface **fs_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; @@ -3130,8 +3128,8 @@ weston_surface_set_initial_position (struct weston_surface *surface, */ 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; } } @@ -3851,7 +3849,7 @@ static const struct weston_keyboard_grab_interface switcher_grab = { }; 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; @@ -3871,7 +3869,7 @@ switcher_binding(struct wl_seat *seat, uint32_t time, uint32_t key, } 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; @@ -3904,7 +3902,7 @@ backlight_binding(struct wl_seat *seat, uint32_t time, uint32_t key, } 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; @@ -4017,7 +4015,7 @@ struct weston_keyboard_grab_interface debug_binding_keyboard_grab = { }; 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; @@ -4032,7 +4030,7 @@ debug_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data) } 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; @@ -4059,7 +4057,7 @@ force_kill_binding(struct wl_seat *seat, uint32_t time, uint32_t key, } 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; @@ -4074,7 +4072,7 @@ workspace_up_binding(struct wl_seat *seat, uint32_t time, } 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; @@ -4089,7 +4087,7 @@ workspace_down_binding(struct wl_seat *seat, uint32_t time, } 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; @@ -4105,7 +4103,7 @@ workspace_f_binding(struct wl_seat *seat, uint32_t time, } 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; @@ -4121,7 +4119,7 @@ workspace_move_surface_up_binding(struct wl_seat *seat, uint32_t time, } 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; diff --git a/src/tablet-shell.c b/src/tablet-shell.c index a125bbcb..87df80ab 100644 --- a/src/tablet-shell.c +++ b/src/tablet-shell.c @@ -445,7 +445,7 @@ long_press_handler(void *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; @@ -456,7 +456,7 @@ menu_key_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *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; diff --git a/src/text-backend.c b/src/text-backend.c index aa91da72..ed9bf8bc 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -571,7 +571,7 @@ input_method_context_grab_keyboard(struct wl_client *client, 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); @@ -600,7 +600,7 @@ input_method_context_key(struct wl_client *client, { 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); @@ -618,7 +618,7 @@ input_method_context_modifiers(struct wl_client *client, 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, @@ -712,7 +712,8 @@ input_method_context_create(struct text_input *model, 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) @@ -811,8 +812,8 @@ input_method_init_seat(struct weston_seat *seat) 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; diff --git a/src/udev-seat.c b/src/udev-seat.c index bdd3ef5a..7e624293 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -231,7 +231,7 @@ udev_seat_remove_devices(struct udev_seat *seat) 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); } diff --git a/src/xwayland/selection.c b/src/xwayland/selection.c index edc7ce6a..69665b73 100644 --- a/src/xwayland/selection.c +++ b/src/xwayland/selection.c @@ -195,8 +195,8 @@ weston_wm_get_selection_targets(struct weston_wm *wm) } 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); } @@ -441,7 +441,7 @@ weston_wm_send_data(struct weston_wm *wm, xcb_atom_t target, const char *mime_ty weston_wm_read_data_source, wm); - source = seat->seat.selection_data_source; + source = seat->selection_data_source; source->send(source, mime_type, p[1]); } @@ -563,7 +563,7 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, * 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; @@ -619,7 +619,7 @@ weston_wm_handle_selection_event(struct weston_wm *wm, 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; @@ -697,7 +697,7 @@ weston_wm_selection_init(struct weston_wm *wm) 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); } diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index ccce277c..e1147dbf 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -1015,8 +1015,8 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window, 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]; diff --git a/src/zoom.c b/src/zoom.c index d57b8683..ccc5d492 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -168,10 +168,10 @@ weston_zoom_frame_xy(struct weston_animation *animation, 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); } @@ -337,15 +337,15 @@ WL_EXPORT void 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; diff --git a/tests/weston-test.c b/tests/weston-test.c index ba01a0e0..612841b5 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -68,7 +68,7 @@ static void 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); } @@ -119,7 +119,7 @@ move_pointer(struct wl_client *client, struct wl_resource *resource, { 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; @@ -155,7 +155,7 @@ activate_surface(struct wl_client *client, struct wl_resource *resource, 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 {