From e4e912ea91a5a36d9f17c1730ffbf29707984399 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 26 May 2018 16:26:10 +1000 Subject: Store swayc coordinates as layout-local --- sway/desktop/xwayland.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'sway/desktop/xwayland.c') diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 783868bc..fc488162 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -152,9 +152,7 @@ static uint32_t get_int_prop(struct sway_view *view, enum sway_view_prop prop) { } } -// The x and y arguments are output-local for tiled views, and layout -// coordinates for floating views. -static void configure(struct sway_view *view, double x, double y, int width, +static void configure(struct sway_view *view, double lx, double ly, int width, int height) { struct sway_xwayland_view *xwayland_view = xwayland_view_from_view(view); if (xwayland_view == NULL) { @@ -162,30 +160,6 @@ static void configure(struct sway_view *view, double x, double y, int width, } struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; - double lx, ly; - if (container_is_floating(view->swayc)) { - lx = x; - ly = y; - } else { - struct sway_container *output = container_parent(view->swayc, C_OUTPUT); - if (!sway_assert(output, "view must be within tree to set position")) { - return; - } - struct sway_container *root = container_parent(output, C_ROOT); - if (!sway_assert(root, "output must be within tree to set position")) { - return; - } - struct wlr_output_layout *layout = root->sway_root->output_layout; - struct wlr_output_layout_output *loutput = - wlr_output_layout_get(layout, output->sway_output->wlr_output); - if (!sway_assert(loutput, - "output must be within layout to set position")) { - return; - } - lx = x + loutput->x; - ly = y + loutput->y; - } - xwayland_view->pending_width = width; xwayland_view->pending_height = height; wlr_xwayland_surface_configure(xsurface, lx, ly, width, height); -- cgit v1.2.3-70-g09d2