aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-11 12:19:20 -0400
committerLibravatar emersion <contact@emersion.fr>2019-03-13 09:06:04 +0100
commitacdb4ed7a32a7cefd4ac37190ba65d33d752bee0 (patch)
tree40d25d69b182c7a888fb8442d803cae9b8a19bfd /sway/desktop/xwayland.c
parentcriteria: change workspace to support regex (diff)
downloadsway-acdb4ed7a32a7cefd4ac37190ba65d33d752bee0.tar.gz
sway-acdb4ed7a32a7cefd4ac37190ba65d33d752bee0.tar.zst
sway-acdb4ed7a32a7cefd4ac37190ba65d33d752bee0.zip
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.
Diffstat (limited to 'sway/desktop/xwayland.c')
-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) {
432 return; 432 return;
433 } 433 }
434 if (container_is_floating(view->container)) { 434 if (container_is_floating(view->container)) {
435 configure(view, view->container->current.content_x, 435 // Respect minimum and maximum sizes
436 view->container->current.content_y, ev->width, ev->height); 436 view->natural_width = ev->width;
437 view->natural_height = ev->height;
438 container_init_floating(view->container);
439
440 configure(view, view->container->content_x,
441 view->container->content_y,
442 view->container->content_width,
443 view->container->content_height);
444 node_set_dirty(&view->container->node);
437 } else { 445 } else {
438 configure(view, view->container->current.content_x, 446 configure(view, view->container->current.content_x,
439 view->container->current.content_y, 447 view->container->current.content_y,