From 7f402c1c6be99dcd92092eb37fbfd6c31624f1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 30 Jul 2020 15:02:18 +0200 Subject: [PATCH] workspace: Cap scaled floating size to target layout size A window preview's floating geometry is scaled down according to the workspace's allocation, while the layout geometry is computed directly for the available space. For previews that maintain their real size in the layout geometry, that scaling leads to a distracting size bounce when transitioning between both layouts. Address that by not allowing the scaled floating size to drop below that layout size (which is at most equal to the unscaled floating size). https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2968 --- js/ui/workspace.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index d7e179b1d..ee7cbdc20 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -614,6 +614,11 @@ var WorkspaceLayout = GObject.registerClass({ } workspaceBox.scale(allocationScale); + // don't allow the scaled floating size to drop below + // the target layout size + workspaceBox.set_size( + Math.max(workspaceBox.get_width(), width), + Math.max(workspaceBox.get_height(), height)); layoutBox.x1 = x; layoutBox.x2 = layoutBox.x1 + width;