aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-03-11 12:19:20 -0400
committeremersion <contact@emersion.fr>2019-03-13 09:06:04 +0100
commitacdb4ed7a32a7cefd4ac37190ba65d33d752bee0 (patch)
tree40d25d69b182c7a888fb8442d803cae9b8a19bfd
parent52a61671e93953a06b6b440ede5512e8fe45b35e (diff)
downloadsway-acdb4ed7a32a7cefd4ac37190ba65d33d752bee0.tar.xz
xwayland: handle floating configure request size
This makes it so the container gets resized by a configure request for xwayland floating views. The minimum and maximum sizes are also respected. Previously, the configure request was resizing the surface to the size requested, but never changing the container size. This caused the surface to be rendered outside of the container or to be smaller than the container. The former is never ideal and the latter makes no sense for floating views since the container itself can just be shrunk.
-rw-r--r--sway/desktop/xwayland.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index e0d307e8..a2aa2e08 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -432,8 +432,16 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
return;
}
if (container_is_floating(view->container)) {
- configure(view, view->container->current.content_x,
- view->container->current.content_y, ev->width, ev->height);
+ // Respect minimum and maximum sizes
+ view->natural_width = ev->width;
+ view->natural_height = ev->height;
+ container_init_floating(view->container);
+
+ configure(view, view->container->content_x,
+ view->container->content_y,
+ view->container->content_width,
+ view->container->content_height);
+ node_set_dirty(&view->container->node);
} else {
configure(view, view->container->current.content_x,
view->container->current.content_y,