aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/transaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r--sway/desktop/transaction.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 9155f0a1..e0c3a5d1 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -249,6 +249,26 @@ static void apply_container_state(struct sway_container *container,
249 desktop_damage_box(&box); 249 desktop_damage_box(&box);
250 } 250 }
251 251
252 // If the view hasn't responded to the configure, center it within
253 // the container. This is important for fullscreen views which
254 // refuse to resize to the size of the output.
255 if (view && view->surface) {
256 if (view->surface->current.width < container->width) {
257 container->surface_x = container->content_x +
258 (container->content_width - view->surface->current.width) / 2;
259 } else {
260 container->surface_x = container->content_x;
261 }
262 if (view->surface->current.height < container->height) {
263 container->surface_y = container->content_y +
264 (container->content_height - view->surface->current.height) / 2;
265 } else {
266 container->surface_y = container->content_y;
267 }
268 container->surface_width = view->surface->current.width;
269 container->surface_height = view->surface->current.height;
270 }
271
252 if (!container->node.destroying) { 272 if (!container->node.destroying) {
253 container_discover_outputs(container); 273 container_discover_outputs(container);
254 } 274 }