From 88eec637a44ede8b521c2aa44d0196c99dd5a0e3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 18 Mar 2018 13:58:01 -0400 Subject: [PATCH] Address feedback --- include/wlr/types/wlr_layer_shell.h | 5 +- include/wlr/types/wlr_xdg_shell.h | 4 +- include/wlr/types/wlr_xdg_shell_v6.h | 4 +- protocol/wlr-layer-shell-unstable-v1.xml | 93 +++++++----------------- rootston/xdg_shell.c | 6 +- rootston/xdg_shell_v6.c | 6 +- types/wlr_layer_shell.c | 47 +++++++----- types/wlr_xdg_shell.c | 64 ++++++++-------- types/wlr_xdg_shell_v6.c | 64 ++++++++-------- 9 files changed, 131 insertions(+), 162 deletions(-) diff --git a/include/wlr/types/wlr_layer_shell.h b/include/wlr/types/wlr_layer_shell.h index 46d0b09c..0807fe8d 100644 --- a/include/wlr/types/wlr_layer_shell.h +++ b/include/wlr/types/wlr_layer_shell.h @@ -48,6 +48,7 @@ struct wlr_layer_surface_state { struct { uint32_t top, right, bottom, left; } margin; + bool keyboard_interactive; // Server uint32_t width, height; }; @@ -73,8 +74,8 @@ struct wlr_layer_surface { uint32_t configure_next_serial; struct wl_list configure_list; - struct wlr_layer_surface_state next; // client protocol requests - struct wlr_layer_surface_state pending; // our configure requests + struct wlr_layer_surface_state client_pending; + struct wlr_layer_surface_state server_pending; struct wlr_layer_surface_state current; struct wl_listener surface_destroy_listener; diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 18596462..9938f4b1 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -78,8 +78,8 @@ struct wlr_xdg_toplevel { struct wlr_xdg_surface *parent; bool added; - struct wlr_xdg_toplevel_state next; // client protocol requests - struct wlr_xdg_toplevel_state pending; // our configure requests + struct wlr_xdg_toplevel_state client_pending; + struct wlr_xdg_toplevel_state server_pending; struct wlr_xdg_toplevel_state current; char *title; diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index c6820f01..0867b2f6 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -78,8 +78,8 @@ struct wlr_xdg_toplevel_v6 { struct wlr_xdg_surface_v6 *parent; bool added; - struct wlr_xdg_toplevel_v6_state next; // client protocol requests - struct wlr_xdg_toplevel_v6_state pending; // user configure requests + struct wlr_xdg_toplevel_v6_state client_pending; + struct wlr_xdg_toplevel_v6_state server_pending; struct wlr_xdg_toplevel_v6_state current; char *title; diff --git a/protocol/wlr-layer-shell-unstable-v1.xml b/protocol/wlr-layer-shell-unstable-v1.xml index 29ba9dd4..285c9b8f 100644 --- a/protocol/wlr-layer-shell-unstable-v1.xml +++ b/protocol/wlr-layer-shell-unstable-v1.xml @@ -61,7 +61,6 @@ - @@ -87,11 +86,9 @@ are designed to be rendered as a layer of a stacked desktop-like environment. - Layer surface state (anchor, exclusive zone, margin) is double-buffered. - Protocol requests modify the pending state, as opposed to the current - state in use by the compositor. The wl_surface.commit request atomically - applies all pending state, replacing the current state. After commit, the - new pending state is as documented for each related request. + Layer surface state (anchor, exclusive zone, margin, interactivity) is + double-buffered, and will be applied at the time wl_surface.commit of the + corresponding wl_surface is called. @@ -129,12 +126,31 @@ point on the output, in pixels. Setting this value for edges you are not anchored to has no effect. + The exclusive zone includes the margin. + Margin is double-buffered, see wl_surface.commit. - - - - + + + + + + + + + Set to 1 to request that the seat send keyboard events to this layer + surface. For layers below the shell surface layer, the seat will use + normal focus semantics. For layers above the shell surface layers, the + seat will always give exclusive keyboard focus to the top-most layer + which has keyboard interactivity set to true. + + Layer surfaces receive pointer, touch, and tablet events normally. If + you do not want to receive them, set the input region on your surface + to an empty region. + + Events is double-buffered, see wl_surface.commit. + + @@ -150,15 +166,6 @@ - - - This creates a layer input for this layer surface. This can be used to - control input semantics for the layer surface on the specified wl_seat. - - - - - When a configure event is received, if a client commits the @@ -228,52 +235,4 @@ - - - - Clients can use this interface to specify input semantics for a layer - surface on a given seat. By default, layer surfaces are considered - non-interactive by seats, and will not participate in their focus - semantics or receive input events for them. - - Input state is double-buffered. Protocol requests modify the pending - state, as opposed to the current state in use by the compositor. The - wl_surface.commit request for the associated layer surface atomically - applies all pending state, replacing the current state. After commit, the - new pending state is as documented for each related request. - - - - - Requests that the seat send input events for the specified input devices - to this layer surface. - - Positional events (pointer and touch) will only be sent if the layer - surface is the top-most interactive surface, and only when the position - of these events are relative to the surface. Enter and leave events will - be signalled normally in these cases. - - Keyboard events will treat the layer surface as the only focused surface - on the seat. Upon requesting keyboard events, the layer surface will - receive a keyboard enter event. A leave event is signalled when it - invokes set_events again without keyboard events specified. - - Events is double-buffered, see wl_surface.commit. - - - - - - - This request destroys the layer input. - - - - - - - - - - diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index 62b57641..927bd018 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -252,7 +252,7 @@ static void handle_request_maximize(struct wl_listener *listener, void *data) { return; } - view_maximize(view, surface->toplevel->next.maximized); + view_maximize(view, surface->toplevel->client_pending.maximized); } static void handle_request_fullscreen(struct wl_listener *listener, @@ -403,10 +403,10 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { view->destroy = destroy; roots_surface->view = view; - if (surface->toplevel->next.maximized) { + if (surface->toplevel->client_pending.maximized) { view_maximize(view, true); } - if (surface->toplevel->next.fullscreen) { + if (surface->toplevel->client_pending.fullscreen) { view_set_fullscreen(view, true, NULL); } } diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 11bc0180..ad33c4b0 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -254,7 +254,7 @@ static void handle_request_maximize(struct wl_listener *listener, void *data) { return; } - view_maximize(view, surface->toplevel->next.maximized); + view_maximize(view, surface->toplevel->client_pending.maximized); } static void handle_request_fullscreen(struct wl_listener *listener, @@ -405,10 +405,10 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { view->destroy = destroy; roots_surface->view = view; - if (surface->toplevel->next.maximized) { + if (surface->toplevel->client_pending.maximized) { view_maximize(view, true); } - if (surface->toplevel->next.fullscreen) { + if (surface->toplevel->client_pending.fullscreen) { view_set_fullscreen(view, true, NULL); } } diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index 242d3b14..8063b219 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -76,32 +76,34 @@ static void layer_surface_handle_ack_configure(struct wl_client *client, static void layer_surface_handle_set_anchor(struct wl_client *client, struct wl_resource *resource, uint32_t anchor) { struct wlr_layer_surface *surface = layer_surface_from_resource(resource); - surface->next.anchor = anchor; + surface->client_pending.anchor = anchor; } static void layer_surface_handle_set_exclusive_zone(struct wl_client *client, struct wl_resource *resource, uint32_t zone) { struct wlr_layer_surface *surface = layer_surface_from_resource(resource); - surface->next.exclusive_zone = zone; + surface->client_pending.exclusive_zone = zone; } -static void layer_surface_handle_set_margin(struct wl_client *client, - struct wl_resource *resource, uint32_t top, - uint32_t right, uint32_t bottom, uint32_t left) { +static void layer_surface_handle_set_margin( + struct wl_client *client, struct wl_resource *resource, + int32_t top, int32_t right, int32_t bottom, int32_t left) { struct wlr_layer_surface *surface = layer_surface_from_resource(resource); - surface->next.margin.top = top; - surface->next.margin.right = right; - surface->next.margin.bottom = bottom; - surface->next.margin.left = left; + surface->client_pending.margin.top = top; + surface->client_pending.margin.right = right; + surface->client_pending.margin.bottom = bottom; + surface->client_pending.margin.left = left; } -static void layer_surface_handle_get_popup(struct wl_client *client, - struct wl_resource *resource, struct wl_resource *popup) { - // TODO +static void layer_surface_handle_set_keyboard_interactivity( + struct wl_client *client, struct wl_resource *resource, + uint32_t interactive) { + struct wlr_layer_surface *surface = layer_surface_from_resource(resource); + surface->client_pending.keyboard_interactive = interactive == 1; } -static void layer_surface_handle_get_input(struct wl_client *client, - struct wl_resource *resource, uint32_t id, struct wl_resource *seat) { +static void layer_surface_handle_get_popup(struct wl_client *client, + struct wl_resource *resource, struct wl_resource *popup) { // TODO } @@ -111,8 +113,8 @@ static const struct zwlr_layer_surface_v1_interface layer_surface_implementation .set_anchor = layer_surface_handle_set_anchor, .set_exclusive_zone = layer_surface_handle_set_exclusive_zone, .set_margin = layer_surface_handle_set_margin, + .set_keyboard_interactivity = layer_surface_handle_set_keyboard_interactivity, .get_popup = layer_surface_handle_get_popup, - .get_input = layer_surface_handle_get_input, }; static void layer_surface_unmap(struct wlr_layer_surface *surface) { @@ -165,7 +167,7 @@ static bool wlr_layer_surface_state_changed(struct wlr_layer_surface *surface) { state = &configure->state; } - return !memcmp(state, &surface->pending, + return !memcmp(state, &surface->server_pending, sizeof(struct wlr_layer_surface_state)); } @@ -181,7 +183,7 @@ static void wlr_layer_surface_send_configure(void *user_data) { wl_list_insert(surface->configure_list.prev, &configure->link); configure->serial = surface->configure_next_serial; - configure->state = surface->pending; + configure->state = surface->server_pending; zwlr_layer_surface_v1_send_configure(surface->resource, configure->serial, configure->state.width, configure->state.height); @@ -216,8 +218,8 @@ static uint32_t wlr_layer_surface_schedule_configure( void wlr_layer_surface_configure(struct wlr_layer_surface *surface, uint32_t width, uint32_t height) { - surface->pending.width = width; - surface->pending.height = height; + surface->server_pending.width = width; + surface->server_pending.height = height; wlr_layer_surface_schedule_configure(surface); } @@ -231,6 +233,13 @@ static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, "layer_surface has never been configured"); return; } + + surface->current.anchor = surface->client_pending.anchor; + surface->current.exclusive_zone = surface->client_pending.exclusive_zone; + surface->current.margin = surface->client_pending.margin; + surface->current.keyboard_interactive = + surface->client_pending.keyboard_interactive; + if (!surface->added) { surface->added = true; wlr_signal_emit_safe(&surface->client->shell->events.new_surface, diff --git a/types/wlr_xdg_shell.c b/types/wlr_xdg_shell.c index 382cf839..d3be2c4f 100644 --- a/types/wlr_xdg_shell.c +++ b/types/wlr_xdg_shell.c @@ -815,23 +815,23 @@ static void xdg_toplevel_handle_set_max_size(struct wl_client *client, struct wl_resource *resource, int32_t width, int32_t height) { struct wlr_xdg_surface *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.max_width = width; - surface->toplevel->next.max_height = height; + surface->toplevel->client_pending.max_width = width; + surface->toplevel->client_pending.max_height = height; } static void xdg_toplevel_handle_set_min_size(struct wl_client *client, struct wl_resource *resource, int32_t width, int32_t height) { struct wlr_xdg_surface *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.min_width = width; - surface->toplevel->next.min_height = height; + surface->toplevel->client_pending.min_width = width; + surface->toplevel->client_pending.min_height = height; } static void xdg_toplevel_handle_set_maximized(struct wl_client *client, struct wl_resource *resource) { struct wlr_xdg_surface *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.maximized = true; + surface->toplevel->client_pending.maximized = true; wlr_signal_emit_safe(&surface->toplevel->events.request_maximize, surface); } @@ -839,7 +839,7 @@ static void xdg_toplevel_handle_unset_maximized(struct wl_client *client, struct wl_resource *resource) { struct wlr_xdg_surface *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.maximized = false; + surface->toplevel->client_pending.maximized = false; wlr_signal_emit_safe(&surface->toplevel->events.request_maximize, surface); } @@ -853,7 +853,7 @@ static void xdg_toplevel_handle_set_fullscreen(struct wl_client *client, output = wlr_output_from_resource(output_resource); } - surface->toplevel->next.fullscreen = true; + surface->toplevel->client_pending.fullscreen = true; struct wlr_xdg_toplevel_set_fullscreen_event event = { .surface = surface, @@ -869,7 +869,7 @@ static void xdg_toplevel_handle_unset_fullscreen(struct wl_client *client, struct wlr_xdg_surface *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.fullscreen = false; + surface->toplevel->client_pending.fullscreen = false; struct wlr_xdg_toplevel_set_fullscreen_event event = { .surface = surface, @@ -1087,25 +1087,25 @@ static bool wlr_xdg_surface_toplevel_state_compare( configured.height = configure->toplevel_state->height; } - if (state->pending.activated != configured.state.activated) { + if (state->server_pending.activated != configured.state.activated) { return false; } - if (state->pending.fullscreen != configured.state.fullscreen) { + if (state->server_pending.fullscreen != configured.state.fullscreen) { return false; } - if (state->pending.maximized != configured.state.maximized) { + if (state->server_pending.maximized != configured.state.maximized) { return false; } - if (state->pending.resizing != configured.state.resizing) { + if (state->server_pending.resizing != configured.state.resizing) { return false; } - if (state->pending.width == configured.width && - state->pending.height == configured.height) { + if (state->server_pending.width == configured.width && + state->server_pending.height == configured.height) { return true; } - if (state->pending.width == 0 && state->pending.height == 0) { + if (state->server_pending.width == 0 && state->server_pending.height == 0) { return true; } @@ -1123,12 +1123,12 @@ static void wlr_xdg_toplevel_send_configure( wl_resource_post_no_memory(surface->toplevel->resource); return; } - *configure->toplevel_state = surface->toplevel->pending; + *configure->toplevel_state = surface->toplevel->server_pending; uint32_t *s; struct wl_array states; wl_array_init(&states); - if (surface->toplevel->pending.maximized) { + if (surface->toplevel->server_pending.maximized) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for maximized xdg_toplevel"); @@ -1136,7 +1136,7 @@ static void wlr_xdg_toplevel_send_configure( } *s = XDG_TOPLEVEL_STATE_MAXIMIZED; } - if (surface->toplevel->pending.fullscreen) { + if (surface->toplevel->server_pending.fullscreen) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for fullscreen xdg_toplevel"); @@ -1144,7 +1144,7 @@ static void wlr_xdg_toplevel_send_configure( } *s = XDG_TOPLEVEL_STATE_FULLSCREEN; } - if (surface->toplevel->pending.resizing) { + if (surface->toplevel->server_pending.resizing) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for resizing xdg_toplevel"); @@ -1152,7 +1152,7 @@ static void wlr_xdg_toplevel_send_configure( } *s = XDG_TOPLEVEL_STATE_RESIZING; } - if (surface->toplevel->pending.activated) { + if (surface->toplevel->server_pending.activated) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for activated xdg_toplevel"); @@ -1161,8 +1161,8 @@ static void wlr_xdg_toplevel_send_configure( *s = XDG_TOPLEVEL_STATE_ACTIVATED; } - uint32_t width = surface->toplevel->pending.width; - uint32_t height = surface->toplevel->pending.height; + uint32_t width = surface->toplevel->server_pending.width; + uint32_t height = surface->toplevel->server_pending.height; xdg_toplevel_send_configure(surface->toplevel->resource, width, height, &states); @@ -1270,13 +1270,13 @@ static void wlr_xdg_surface_toplevel_committed( // update state that doesn't need compositor approval surface->toplevel->current.max_width = - surface->toplevel->next.max_width; + surface->toplevel->client_pending.max_width; surface->toplevel->current.min_width = - surface->toplevel->next.min_width; + surface->toplevel->client_pending.min_width; surface->toplevel->current.max_height = - surface->toplevel->next.max_height; + surface->toplevel->client_pending.max_height; surface->toplevel->current.min_height = - surface->toplevel->next.min_height; + surface->toplevel->client_pending.min_height; } static void wlr_xdg_surface_popup_committed( @@ -1561,8 +1561,8 @@ void wlr_xdg_surface_ping(struct wlr_xdg_surface *surface) { uint32_t wlr_xdg_toplevel_set_size(struct wlr_xdg_surface *surface, uint32_t width, uint32_t height) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); - surface->toplevel->pending.width = width; - surface->toplevel->pending.height = height; + surface->toplevel->server_pending.width = width; + surface->toplevel->server_pending.height = height; return wlr_xdg_surface_schedule_configure(surface); } @@ -1570,7 +1570,7 @@ uint32_t wlr_xdg_toplevel_set_size(struct wlr_xdg_surface *surface, uint32_t wlr_xdg_toplevel_set_activated(struct wlr_xdg_surface *surface, bool activated) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); - surface->toplevel->pending.activated = activated; + surface->toplevel->server_pending.activated = activated; return wlr_xdg_surface_schedule_configure(surface); } @@ -1578,7 +1578,7 @@ uint32_t wlr_xdg_toplevel_set_activated(struct wlr_xdg_surface *surface, uint32_t wlr_xdg_toplevel_set_maximized(struct wlr_xdg_surface *surface, bool maximized) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); - surface->toplevel->pending.maximized = maximized; + surface->toplevel->server_pending.maximized = maximized; return wlr_xdg_surface_schedule_configure(surface); } @@ -1586,7 +1586,7 @@ uint32_t wlr_xdg_toplevel_set_maximized(struct wlr_xdg_surface *surface, uint32_t wlr_xdg_toplevel_set_fullscreen(struct wlr_xdg_surface *surface, bool fullscreen) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); - surface->toplevel->pending.fullscreen = fullscreen; + surface->toplevel->server_pending.fullscreen = fullscreen; return wlr_xdg_surface_schedule_configure(surface); } @@ -1594,7 +1594,7 @@ uint32_t wlr_xdg_toplevel_set_fullscreen(struct wlr_xdg_surface *surface, uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface, bool resizing) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); - surface->toplevel->pending.resizing = resizing; + surface->toplevel->server_pending.resizing = resizing; return wlr_xdg_surface_schedule_configure(surface); } diff --git a/types/wlr_xdg_shell_v6.c b/types/wlr_xdg_shell_v6.c index 4c40e129..65b461b7 100644 --- a/types/wlr_xdg_shell_v6.c +++ b/types/wlr_xdg_shell_v6.c @@ -785,23 +785,23 @@ static void xdg_toplevel_handle_set_max_size(struct wl_client *client, struct wl_resource *resource, int32_t width, int32_t height) { struct wlr_xdg_surface_v6 *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.max_width = width; - surface->toplevel->next.max_height = height; + surface->toplevel->client_pending.max_width = width; + surface->toplevel->client_pending.max_height = height; } static void xdg_toplevel_handle_set_min_size(struct wl_client *client, struct wl_resource *resource, int32_t width, int32_t height) { struct wlr_xdg_surface_v6 *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.min_width = width; - surface->toplevel->next.min_height = height; + surface->toplevel->client_pending.min_width = width; + surface->toplevel->client_pending.min_height = height; } static void xdg_toplevel_handle_set_maximized(struct wl_client *client, struct wl_resource *resource) { struct wlr_xdg_surface_v6 *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.maximized = true; + surface->toplevel->client_pending.maximized = true; wlr_signal_emit_safe(&surface->toplevel->events.request_maximize, surface); } @@ -809,7 +809,7 @@ static void xdg_toplevel_handle_unset_maximized(struct wl_client *client, struct wl_resource *resource) { struct wlr_xdg_surface_v6 *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.maximized = false; + surface->toplevel->client_pending.maximized = false; wlr_signal_emit_safe(&surface->toplevel->events.request_maximize, surface); } @@ -823,7 +823,7 @@ static void xdg_toplevel_handle_set_fullscreen(struct wl_client *client, output = wlr_output_from_resource(output_resource); } - surface->toplevel->next.fullscreen = true; + surface->toplevel->client_pending.fullscreen = true; struct wlr_xdg_toplevel_v6_set_fullscreen_event event = { .surface = surface, @@ -839,7 +839,7 @@ static void xdg_toplevel_handle_unset_fullscreen(struct wl_client *client, struct wlr_xdg_surface_v6 *surface = xdg_surface_from_xdg_toplevel_resource(resource); - surface->toplevel->next.fullscreen = false; + surface->toplevel->client_pending.fullscreen = false; struct wlr_xdg_toplevel_v6_set_fullscreen_event event = { .surface = surface, @@ -1057,25 +1057,25 @@ static bool wlr_xdg_surface_v6_toplevel_state_compare( configured.height = configure->toplevel_state->height; } - if (state->pending.activated != configured.state.activated) { + if (state->server_pending.activated != configured.state.activated) { return false; } - if (state->pending.fullscreen != configured.state.fullscreen) { + if (state->server_pending.fullscreen != configured.state.fullscreen) { return false; } - if (state->pending.maximized != configured.state.maximized) { + if (state->server_pending.maximized != configured.state.maximized) { return false; } - if (state->pending.resizing != configured.state.resizing) { + if (state->server_pending.resizing != configured.state.resizing) { return false; } - if (state->pending.width == configured.width && - state->pending.height == configured.height) { + if (state->server_pending.width == configured.width && + state->server_pending.height == configured.height) { return true; } - if (state->pending.width == 0 && state->pending.height == 0) { + if (state->server_pending.width == 0 && state->server_pending.height == 0) { return true; } @@ -1093,12 +1093,12 @@ static void wlr_xdg_toplevel_v6_send_configure( wl_resource_post_no_memory(surface->toplevel->resource); return; } - *configure->toplevel_state = surface->toplevel->pending; + *configure->toplevel_state = surface->toplevel->server_pending; uint32_t *s; struct wl_array states; wl_array_init(&states); - if (surface->toplevel->pending.maximized) { + if (surface->toplevel->server_pending.maximized) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for maximized xdg_toplevel"); @@ -1106,7 +1106,7 @@ static void wlr_xdg_toplevel_v6_send_configure( } *s = ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED; } - if (surface->toplevel->pending.fullscreen) { + if (surface->toplevel->server_pending.fullscreen) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for fullscreen xdg_toplevel"); @@ -1114,7 +1114,7 @@ static void wlr_xdg_toplevel_v6_send_configure( } *s = ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN; } - if (surface->toplevel->pending.resizing) { + if (surface->toplevel->server_pending.resizing) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for resizing xdg_toplevel"); @@ -1122,7 +1122,7 @@ static void wlr_xdg_toplevel_v6_send_configure( } *s = ZXDG_TOPLEVEL_V6_STATE_RESIZING; } - if (surface->toplevel->pending.activated) { + if (surface->toplevel->server_pending.activated) { s = wl_array_add(&states, sizeof(uint32_t)); if (!s) { wlr_log(L_ERROR, "Could not allocate state for activated xdg_toplevel"); @@ -1131,8 +1131,8 @@ static void wlr_xdg_toplevel_v6_send_configure( *s = ZXDG_TOPLEVEL_V6_STATE_ACTIVATED; } - uint32_t width = surface->toplevel->pending.width; - uint32_t height = surface->toplevel->pending.height; + uint32_t width = surface->toplevel->server_pending.width; + uint32_t height = surface->toplevel->server_pending.height; zxdg_toplevel_v6_send_configure(surface->toplevel->resource, width, height, &states); @@ -1240,13 +1240,13 @@ static void wlr_xdg_surface_v6_toplevel_committed( // update state that doesn't need compositor approval surface->toplevel->current.max_width = - surface->toplevel->next.max_width; + surface->toplevel->client_pending.max_width; surface->toplevel->current.min_width = - surface->toplevel->next.min_width; + surface->toplevel->client_pending.min_width; surface->toplevel->current.max_height = - surface->toplevel->next.max_height; + surface->toplevel->client_pending.max_height; surface->toplevel->current.min_height = - surface->toplevel->next.min_height; + surface->toplevel->client_pending.min_height; } static void wlr_xdg_surface_v6_popup_committed( @@ -1531,8 +1531,8 @@ void wlr_xdg_surface_v6_ping(struct wlr_xdg_surface_v6 *surface) { uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface, uint32_t width, uint32_t height) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); - surface->toplevel->pending.width = width; - surface->toplevel->pending.height = height; + surface->toplevel->server_pending.width = width; + surface->toplevel->server_pending.height = height; return wlr_xdg_surface_v6_schedule_configure(surface); } @@ -1540,7 +1540,7 @@ uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface, uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface, bool activated) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); - surface->toplevel->pending.activated = activated; + surface->toplevel->server_pending.activated = activated; return wlr_xdg_surface_v6_schedule_configure(surface); } @@ -1548,7 +1548,7 @@ uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface, uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface, bool maximized) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); - surface->toplevel->pending.maximized = maximized; + surface->toplevel->server_pending.maximized = maximized; return wlr_xdg_surface_v6_schedule_configure(surface); } @@ -1556,7 +1556,7 @@ uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface, uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface, bool fullscreen) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); - surface->toplevel->pending.fullscreen = fullscreen; + surface->toplevel->server_pending.fullscreen = fullscreen; return wlr_xdg_surface_v6_schedule_configure(surface); } @@ -1564,7 +1564,7 @@ uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface, uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface, bool resizing) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); - surface->toplevel->pending.resizing = resizing; + surface->toplevel->server_pending.resizing = resizing; return wlr_xdg_surface_v6_schedule_configure(surface); }