weston_surface_animation_frame(&animation->animation, NULL, 0);
animation->listener.notify = handle_animation_surface_destroy;
- wl_signal_add(&surface->surface.resource.destroy_signal,
- &animation->listener);
+ wl_signal_add(&surface->resource.destroy_signal, &animation->listener);
wl_list_insert(&surface->output->animation_list,
&animation->animation.link);
element->surface = surface;
element->surface_destroy_listener.notify =
rpi_element_handle_surface_destroy;
- wl_signal_add(&surface->surface.resource.destroy_signal,
+ wl_signal_add(&surface->resource.destroy_signal,
&element->surface_destroy_listener);
wl_list_insert(output->element_list.prev, &element->link);
struct wl_listener *listener;
struct rpi_element *element;
- listener = wl_signal_get(&surface->surface.resource.destroy_signal,
+ listener = wl_signal_get(&surface->resource.destroy_signal,
rpi_element_handle_surface_destroy);
if (!listener)
return NULL;
if (surface == NULL)
return NULL;
- wl_signal_init(&surface->surface.resource.destroy_signal);
+ wl_signal_init(&surface->resource.destroy_signal);
wl_list_init(&surface->link);
wl_list_init(&surface->layer_link);
- surface->surface.resource.client = NULL;
+ surface->resource.client = NULL;
surface->compositor = compositor;
surface->alpha = 1.0;
uint32_t left = es->output_mask & different;
struct weston_output *output;
struct wl_resource *resource = NULL;
- struct wl_client *client = es->surface.resource.client;
+ struct wl_client *client = es->resource.client;
es->output_mask = mask;
- if (es->surface.resource.client == NULL)
+ if (es->resource.client == NULL)
return;
if (different == 0)
return;
if (resource == NULL)
continue;
if (1 << output->id & entered)
- wl_surface_send_enter(&es->surface.resource, resource);
+ wl_surface_send_enter(&es->resource, resource);
if (1 << output->id & left)
- wl_surface_send_leave(&es->surface.resource, resource);
+ wl_surface_send_leave(&es->resource, resource);
}
}
surface->geometry.parent_destroy_listener.notify =
transform_parent_handle_parent_destroy;
if (parent) {
- wl_signal_add(&parent->surface.resource.destroy_signal,
+ wl_signal_add(&parent->resource.destroy_signal,
&surface->geometry.parent_destroy_listener);
wl_list_insert(&parent->geometry.child_list,
&surface->geometry.parent_link);
wl_list_remove(&surface->layer_link);
wl_list_for_each(seat, &surface->compositor->seat_list, link) {
- if (seat->keyboard &&
- seat->keyboard->focus == &surface->surface)
+ if (seat->keyboard && seat->keyboard->focus == surface)
weston_keyboard_set_focus(seat->keyboard, NULL);
- if (seat->pointer &&
- seat->pointer->focus == &surface->surface)
+ if (seat->pointer && seat->pointer->focus == surface)
weston_pointer_set_focus(seat->pointer,
NULL,
wl_fixed_from_int(0),
destroy_surface(struct wl_resource *resource)
{
struct weston_surface *surface =
- container_of(resource,
- struct weston_surface, surface.resource);
+ container_of(resource, struct weston_surface, resource);
struct weston_compositor *compositor = surface->compositor;
struct weston_frame_callback *cb, *next;
weston_surface_destroy(struct weston_surface *surface)
{
/* Not a valid way to destroy a client surface */
- assert(surface->surface.resource.client == NULL);
+ assert(surface->resource.client == NULL);
- wl_signal_emit(&surface->surface.resource.destroy_signal,
- &surface->surface.resource);
- destroy_surface(&surface->surface.resource);
+ wl_signal_emit(&surface->resource.destroy_signal, &surface->resource);
+ destroy_surface(&surface->resource);
}
static void
return;
}
- surface->surface.resource.destroy = destroy_surface;
+ surface->resource.destroy = destroy_surface;
- surface->surface.resource.object.id = id;
- surface->surface.resource.object.interface = &wl_surface_interface;
- surface->surface.resource.object.implementation =
+ surface->resource.object.id = id;
+ surface->resource.object.interface = &wl_surface_interface;
+ surface->resource.object.implementation =
(void (**)(void)) &surface_interface;
- surface->surface.resource.data = surface;
+ surface->resource.data = surface;
- wl_client_add_resource(client, &surface->surface.resource);
+ wl_client_add_resource(client, &surface->resource);
}
static void
struct weston_pointer_grab;
struct weston_pointer_grab_interface {
void (*focus)(struct weston_pointer_grab *grab,
- struct wl_surface *surface,
+ struct weston_surface *surface,
wl_fixed_t x,
wl_fixed_t y);
void (*motion)(struct weston_pointer_grab *grab,
struct weston_pointer_grab {
const struct weston_pointer_grab_interface *interface;
struct weston_pointer *pointer;
- struct wl_surface *focus;
+ struct weston_surface *focus;
wl_fixed_t x, y;
};
struct weston_keyboard_grab {
const struct weston_keyboard_grab_interface *interface;
struct weston_keyboard *keyboard;
- struct wl_surface *focus;
+ struct weston_surface *focus;
uint32_t key;
};
struct weston_touch_grab {
const struct weston_touch_grab_interface *interface;
struct weston_touch *touch;
- struct wl_surface *focus;
+ struct weston_surface *focus;
};
struct wl_data_offer {
struct weston_seat *seat;
struct wl_list resource_list;
- struct wl_surface *focus;
+ struct weston_surface *focus;
struct wl_resource *focus_resource;
struct wl_listener focus_listener;
uint32_t focus_serial;
uint32_t grab_time;
wl_fixed_t x, y;
- struct wl_surface *current;
+ struct weston_surface *current;
struct wl_listener current_listener;
wl_fixed_t current_x, current_y;
struct weston_seat *seat;
struct wl_list resource_list;
- struct wl_surface *focus;
+ struct weston_surface *focus;
struct wl_resource *focus_resource;
struct wl_listener focus_listener;
uint32_t focus_serial;
weston_pointer_destroy(struct weston_pointer *pointer);
void
weston_pointer_set_focus(struct weston_pointer *pointer,
- struct wl_surface *surface,
+ struct weston_surface *surface,
wl_fixed_t sx, wl_fixed_t sy);
void
weston_pointer_start_grab(struct weston_pointer *pointer,
weston_pointer_end_grab(struct weston_pointer *pointer);
void
weston_pointer_set_current(struct weston_pointer *pointer,
- struct wl_surface *surface);
+ struct weston_surface *surface);
struct weston_keyboard *
weston_keyboard_create(void);
weston_keyboard_destroy(struct weston_keyboard *keyboard);
void
weston_keyboard_set_focus(struct weston_keyboard *keyboard,
- struct wl_surface *surface);
+ struct weston_surface *surface);
void
weston_keyboard_start_grab(struct weston_keyboard *device,
struct weston_keyboard_grab *grab);
struct weston_seat *seat;
struct wl_list resource_list;
- struct wl_surface *focus;
+ struct weston_surface *focus;
struct wl_resource *focus_resource;
struct wl_listener focus_listener;
uint32_t focus_serial;
int32_t hotspot_x, hotspot_y;
struct wl_list link;
enum weston_keyboard_modifier modifier_state;
- struct wl_surface *saved_kbd_focus;
+ struct weston_surface *saved_kbd_focus;
struct wl_listener saved_kbd_focus_listener;
uint32_t selection_serial;
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 weston_surface *drag_focus;
struct wl_resource *drag_focus_resource;
struct wl_listener drag_focus_listener;
struct weston_pointer_grab drag_grab;
*/
struct weston_surface {
- struct wl_surface surface;
+ struct wl_resource resource;
struct weston_compositor *compositor;
pixman_region32_t clip;
pixman_region32_t damage;
struct weston_surface *surface)
{
if (surface->configure) {
- wl_resource_post_error(&surface->surface.resource,
+ wl_resource_post_error(&surface->resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"surface->configure already set");
return 0;
surface->configure = drag_surface_configure;
surface->configure_private = seat;
- wl_signal_add(&surface->surface.resource.destroy_signal,
+ wl_signal_add(&surface->resource.destroy_signal,
&seat->drag_surface_destroy_listener);
return 1;
static void
drag_grab_focus(struct weston_pointer_grab *grab,
- struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
+ struct weston_surface *surface, wl_fixed_t x, wl_fixed_t y)
{
struct weston_seat *seat =
container_of(grab, struct weston_seat, drag_grab);
&pointer->current_x,
&pointer->current_y);
- if (&surface->surface != pointer->current) {
+ if (surface != pointer->current) {
interface = pointer->grab->interface;
- weston_pointer_set_current(pointer, &surface->surface);
- interface->focus(pointer->grab, &surface->surface,
- pointer->current_x,
- pointer->current_y);
+ weston_pointer_set_current(pointer, surface);
+ interface->focus(pointer->grab, surface,
+ pointer->current_x, pointer->current_y);
}
focus = (struct weston_surface *) pointer->grab->focus;
static void
default_grab_focus(struct weston_pointer_grab *grab,
- struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
+ struct weston_surface *surface, wl_fixed_t x, wl_fixed_t y)
{
struct weston_pointer *pointer = grab->pointer;
}
static struct wl_resource *
-find_resource_for_surface(struct wl_list *list, struct wl_surface *surface)
+find_resource_for_surface(struct wl_list *list, struct weston_surface *surface)
{
struct wl_resource *r;
WL_EXPORT void
weston_pointer_set_focus(struct weston_pointer *pointer,
- struct wl_surface *surface,
+ struct weston_surface *surface,
wl_fixed_t sx, wl_fixed_t sy)
{
struct weston_keyboard *kbd = pointer->seat->keyboard;
WL_EXPORT void
weston_keyboard_set_focus(struct weston_keyboard *keyboard,
- struct wl_surface *surface)
+ struct weston_surface *surface)
{
struct wl_resource *resource;
struct wl_display *display;
WL_EXPORT void
weston_pointer_set_current(struct weston_pointer *pointer,
- struct wl_surface *surface)
+ struct weston_surface *surface)
{
if (pointer->current)
wl_list_remove(&pointer->current_listener.link);
struct weston_compositor *compositor = seat->compositor;
if (seat->keyboard) {
- weston_keyboard_set_focus(seat->keyboard, &surface->surface);
+ weston_keyboard_set_focus(seat->keyboard, surface);
wl_data_device_set_keyboard_focus(seat);
}
{
struct weston_compositor *compositor = seat->compositor;
struct weston_keyboard *keyboard = seat->keyboard;
- struct wl_surface *surface;
+ struct weston_surface *surface;
uint32_t *k, serial;
serial = wl_display_next_serial(compositor->wl_display);
}
static void
-touch_set_focus(struct weston_seat *seat, struct wl_surface *surface)
+touch_set_focus(struct weston_seat *seat, struct weston_surface *surface)
{
struct wl_resource *resource;
* until all touch points are up again. */
if (seat->num_tp == 1) {
es = weston_compositor_pick_surface(ec, x, y, &sx, &sy);
- touch_set_focus(seat, &es->surface);
+ touch_set_focus(seat, es);
} else if (touch->focus) {
es = (struct weston_surface *) touch->focus;
weston_surface_from_global_fixed(es, x, y, &sx, &sy);
if (surface && surface != seat->sprite) {
if (surface->configure) {
- wl_resource_post_error(&surface->surface.resource,
+ wl_resource_post_error(&surface->resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"surface->configure already "
"set");
if (!surface)
return;
- wl_signal_add(&surface->surface.resource.destroy_signal,
+ wl_signal_add(&surface->resource.destroy_signal,
&seat->sprite_destroy_listener);
surface->configure = pointer_cursor_surface_configure;
&grab->shsurf_destroy_listener);
grab->pointer = pointer;
- grab->grab.focus = &shsurf->surface->surface;
+ grab->grab.focus = shsurf->surface;
weston_pointer_start_grab(pointer, &grab->grab);
desktop_shell_send_grab_cursor(shell->child.desktop_shell, cursor);
- weston_pointer_set_focus(pointer, &shell->grab_surface->surface,
+ weston_pointer_set_focus(pointer, shell->grab_surface,
wl_fixed_from_int(0), wl_fixed_from_int(0));
}
restore_focus_state(struct desktop_shell *shell, struct workspace *ws)
{
struct focus_state *state, *next;
- struct wl_surface *surface;
+ struct weston_surface *surface;
wl_list_for_each_safe(state, next, &ws->focus_list, link) {
- surface = state->keyboard_focus ?
- &state->keyboard_focus->surface : NULL;
+ surface = state->keyboard_focus;
weston_keyboard_set_focus(state->seat->keyboard, surface);
}
struct weston_seat *seat)
{
struct focus_state *state;
- struct wl_surface *surface;
+ struct weston_surface *surface;
wl_list_for_each(state, &ws->focus_list, link) {
if (state->seat == seat) {
drop_focus_state(shell, from, surface);
wl_list_for_each(seat, &shell->compositor->seat_list, link)
- if (seat->keyboard &&
- seat->keyboard->focus == &surface->surface)
+ if (seat->keyboard && seat->keyboard->focus == surface)
weston_keyboard_set_focus(seat->keyboard, NULL);
weston_surface_damage_below(surface);
static void
noop_grab_focus(struct weston_pointer_grab *grab,
- struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
+ struct weston_surface *surface, wl_fixed_t x, wl_fixed_t y)
{
grab->focus = NULL;
}
if (seat->pointer->button_count == 0 ||
seat->pointer->grab_serial != serial ||
- seat->pointer->focus != &shsurf->surface->surface)
+ seat->pointer->focus != shsurf->surface)
return;
if (surface_move(shsurf, seat) < 0)
if (seat->pointer->button_count == 0 ||
seat->pointer->grab_serial != serial ||
- seat->pointer->focus != &shsurf->surface->surface)
+ seat->pointer->focus != shsurf->surface)
return;
if (surface_resize(shsurf, seat, edges) < 0)
static void
busy_cursor_grab_focus(struct weston_pointer_grab *base,
- struct wl_surface *surface, int32_t x, int32_t y)
+ struct weston_surface *surface, int32_t x, int32_t y)
{
struct shell_grab *grab = (struct shell_grab *) base;
shsurf->unresponsive = 1;
wl_list_for_each(seat, &shsurf->surface->compositor->seat_list, link)
- if (seat->pointer->focus == &shsurf->surface->surface)
+ if (seat->pointer->focus == shsurf->surface)
set_busy_cursor(shsurf, seat->pointer);
return 1;
/* Received pong from previously unresponsive client */
wl_list_for_each(seat, &ec->seat_list, link) {
pointer = seat->pointer;
- if (pointer->focus ==
- &shell->grab_surface->surface &&
- pointer->current ==
- &shsurf->surface->surface)
+ if (pointer->focus == shell->grab_surface &&
+ pointer->current == shsurf->surface)
end_busy_cursor(shsurf, pointer);
}
}
static void
popup_grab_focus(struct weston_pointer_grab *grab,
- struct wl_surface *surface,
+ struct weston_surface *surface,
wl_fixed_t x,
wl_fixed_t y)
{
struct weston_seat *seat = shseat->seat;
if (wl_list_empty(&shseat->popup_grab.surfaces_list)) {
- shseat->popup_grab.client = shsurf->surface->surface.resource.client;
+ shseat->popup_grab.client = shsurf->resource.client;
shseat->popup_grab.grab.interface = &popup_grab_interface;
/* We must make sure here that this popup was opened after
* a mouse press, and not just by moving around with other
wl_signal_init(&shsurf->resource.destroy_signal);
shsurf->surface_destroy_listener.notify = shell_handle_surface_destroy;
- wl_signal_add(&surface->surface.resource.destroy_signal,
+ wl_signal_add(&surface->resource.destroy_signal,
&shsurf->surface_destroy_listener);
/* init link so its safe to always remove it in destroy_shell_surface */
state->keyboard_focus = es;
wl_list_remove(&state->surface_destroy_listener.link);
- wl_signal_add(&es->surface.resource.destroy_signal,
+ wl_signal_add(&es->resource.destroy_signal,
&state->surface_destroy_listener);
switch (get_shell_surface_type(es)) {
wl_signal_init(&input_panel_surface->resource.destroy_signal);
input_panel_surface->surface_destroy_listener.notify = input_panel_handle_surface_destroy;
- wl_signal_add(&surface->surface.resource.destroy_signal,
+ wl_signal_add(&surface->resource.destroy_signal,
&input_panel_surface->surface_destroy_listener);
wl_list_init(&input_panel_surface->link);
return;
wl_list_remove(&switcher->listener.link);
- wl_signal_add(&next->surface.resource.destroy_signal,
- &switcher->listener);
+ wl_signal_add(&next->resource.destroy_signal, &switcher->listener);
switcher->current = next;
next->alpha = 1.0;
force_kill_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
{
- struct wl_surface *focus_surface;
+ struct weston_surface *focus_surface;
struct wl_client *client;
struct desktop_shell *shell = data;
struct weston_compositor *compositor = shell->compositor;
}
} else if (shell->current_client &&
shell->current_client->surface != surface &&
- shell->current_client->client == surface->surface.resource.client) {
+ shell->current_client->client == surface->resource.client) {
tablet_shell_set_state(shell, STATE_TASK);
shell->current_client->surface = surface;
weston_zoom_run(surface, 0.3, 1.0, NULL, NULL);
shell->lockscreen_surface = es;
shell->lockscreen_surface->configure = tablet_shell_surface_configure;
shell->lockscreen_listener.notify = handle_lockscreen_surface_destroy;
- wl_signal_add(&es->surface.resource.destroy_signal,
+ wl_signal_add(&es->resource.destroy_signal,
&shell->lockscreen_listener);
}
weston_surface_set_position(shell->switcher_surface, 0, 0);
shell->switcher_listener.notify = handle_switcher_surface_destroy;
- wl_signal_add(&es->surface.resource.destroy_signal,
- &shell->switcher_listener);
+ wl_signal_add(&es->resource.destroy_signal, &shell->switcher_listener);
}
static void
struct wl_list input_methods;
- struct wl_surface *surface;
+ struct weston_surface *surface;
pixman_box32_t cursor_rectangle;
struct weston_keyboard *keyboard = data;
struct input_method *input_method =
container_of(listener, struct input_method, keyboard_focus_listener);
- struct wl_surface *surface = keyboard->focus;
+ struct weston_surface *surface = keyboard->focus;
if (!input_method->model)
return;
&wm->server->compositor->shell_interface;
if (seat->pointer->button_count != 1 ||
- seat->pointer->focus != &window->surface->surface)
+ seat->pointer->focus != window->surface)
return;
detail = client_message->data.data32[2];
static struct weston_wm_window *
get_wm_window(struct weston_surface *surface)
{
- struct wl_resource *resource = &surface->surface.resource;
+ struct wl_resource *resource = &surface->resource;
struct wl_listener *listener;
listener = wl_signal_get(&resource->destroy_signal, surface_destroy);
{
struct weston_xserver *wxs = resource->data;
struct weston_wm *wm = wxs->wm;
- struct wl_surface *surface = surface_resource->data;
+ struct weston_surface *surface = surface_resource->data;
struct weston_wm_window *window;
if (client != wxs->client)