From 59c94887018bdfa578c4371c4275061ca6e71b3e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 3 Jun 2018 16:35:06 +1000 Subject: WIP: Atomic layout updates ground work --- sway/desktop/xdg_shell.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'sway/desktop/xdg_shell.c') diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index d2b8822c..f43a0a1b 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c @@ -5,6 +5,7 @@ #include #include #include "log.h" +#include "sway/desktop/transaction.h" #include "sway/input/input-manager.h" #include "sway/input/seat.h" #include "sway/server.h" @@ -87,18 +88,14 @@ static const char *get_string_prop(struct sway_view *view, enum sway_view_prop p } } -static void configure(struct sway_view *view, double lx, double ly, int width, - int height) { +static uint32_t configure(struct sway_view *view, double lx, double ly, + int width, int height) { struct sway_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); if (xdg_shell_view == NULL) { - return; + return 0; } - - xdg_shell_view->pending_width = width; - xdg_shell_view->pending_height = height; - wlr_xdg_toplevel_set_size(view->wlr_xdg_surface, width, height); - view_update_position(view, lx, ly); + return wlr_xdg_toplevel_set_size(view->wlr_xdg_surface, width, height); } static void set_activated(struct sway_view *view, bool activated) { @@ -174,18 +171,12 @@ static void handle_commit(struct wl_listener *listener, void *data) { struct sway_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, commit); struct sway_view *view = &xdg_shell_view->view; - if (view->swayc && container_is_floating(view->swayc)) { - int width = view->wlr_xdg_surface->geometry.width; - int height = view->wlr_xdg_surface->geometry.height; - if (!width && !height) { - width = view->wlr_xdg_surface->surface->current->width; - height = view->wlr_xdg_surface->surface->current->height; - } - view_update_size(view, width, height); - } else { - view_update_size(view, xdg_shell_view->pending_width, - xdg_shell_view->pending_height); + struct wlr_xdg_surface *xdg_surface = view->wlr_xdg_surface; + + if (view->instructions->length) { + transaction_notify_view_ready(view, xdg_surface->configure_serial); } + view_update_title(view, false); view_damage_from(view); } -- cgit v1.2.3