Set view->surface

This commit is contained in:
emersion 2017-09-27 15:03:35 +02:00
parent acf58e04de
commit e001e40022
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 12 additions and 12 deletions

View file

@ -290,7 +290,7 @@ static void handle_output_frame(struct output_state *output,
struct wlr_wl_shell_surface *wl_shell_surface;
wl_list_for_each(wl_shell_surface, &sample->wl_shell->surfaces, link) {
output_frame_handle_surface(sample, wlr_output, ts,
wl_shell_surface->surface, 200, 200);
wl_shell_surface->resource, 200, 200);
}
struct wlr_xdg_surface_v6 *xdg_surface;
struct wlr_xdg_client_v6 *xdg_client;

View file

@ -19,8 +19,8 @@ struct wlr_wl_shell {
struct wlr_wl_shell_surface {
struct wlr_wl_shell *shell;
struct wl_client *client;
struct wl_resource *surface;
struct wlr_texture *wlr_texture;
struct wl_resource *resource;
struct wlr_surface *surface;
struct wl_list link;
uint32_t ping_serial;

View file

@ -27,7 +27,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
view->x = view->y = 200;
view->wl_shell_surface = surface;
view->roots_wl_shell_surface = roots_surface;
//view->wlr_surface = surface->surface;
view->wlr_surface = surface->surface;
//view->get_input_bounds = get_input_bounds;
//view->activate = activate;
view->desktop = desktop;

View file

@ -96,9 +96,9 @@ static int wlr_wl_shell_surface_ping_timeout(void *user_data) {
static void wl_shell_get_shell_surface(struct wl_client *client,
struct wl_resource *resource, uint32_t id,
struct wl_resource *surface) {
struct wlr_texture *wlr_texture = wl_resource_get_user_data(surface);
struct wlr_wl_shell *wlr_wl_shell = wl_resource_get_user_data(resource);
struct wl_resource *surface_resource) {
struct wlr_surface *surface = wl_resource_get_user_data(surface_resource);
struct wlr_wl_shell *wl_shell = wl_resource_get_user_data(resource);
struct wlr_wl_shell_surface *state =
calloc(1, sizeof(struct wlr_wl_shell_surface));
if (state == NULL) {
@ -106,9 +106,9 @@ static void wl_shell_get_shell_surface(struct wl_client *client,
return;
}
state->shell = wlr_wl_shell;
state->shell = wl_shell;
state->client = client;
state->wlr_texture = wlr_texture;
state->resource = surface_resource;
state->surface = surface;
struct wl_resource *shell_surface_resource = wl_resource_create(client,
@ -127,8 +127,8 @@ static void wl_shell_get_shell_surface(struct wl_client *client,
wl_client_post_no_memory(client);
}
wl_list_insert(&wlr_wl_shell->surfaces, &state->link);
wl_signal_emit(&wlr_wl_shell->events.new_surface, state);
wl_list_insert(&wl_shell->surfaces, &state->link);
wl_signal_emit(&wl_shell->events.new_surface, state);
}
static struct wl_shell_interface wl_shell_impl = {
@ -200,5 +200,5 @@ void wlr_wl_shell_surface_ping(struct wlr_wl_shell_surface *surface) {
wl_display_next_serial(wl_client_get_display(surface->client));
wl_event_source_timer_update(surface->ping_timer,
surface->shell->ping_timeout);
wl_shell_surface_send_ping(surface->surface, surface->ping_serial);
wl_shell_surface_send_ping(surface->resource, surface->ping_serial);
}