[PATCH weston] shell: Don't draw shadows for maximized windows.

Scott Moreau oreaus at gmail.com
Tue Aug 7 20:39:37 PDT 2012


This effectively fixes a bug where maximized windows appear to not maximize
fully bacause of the shadow margin. Instead, we now maximize the window to
the understood input region.
---

This problem is much more easily and appropriately fixed in shell.c but it makes
the assumption that the input_region is the same for top/bottom and left/right.
We can't calulate bottom or right margin in shell_surface_set_maximized()
because the input region hasn't been updated and there's no way to know in
advance before the configure event. So we have the client resize its surface
accounting for the (shadow) margin, which in this case, is a constant margin for
all sides, derived from the theme margin. We then position the surface taking
into consideration the same.

 src/shell.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index 6c810ff..0580aeb 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1362,8 +1362,11 @@ shell_surface_set_maximized(struct wl_client *client,
 	edges = WL_SHELL_SURFACE_RESIZE_TOP|WL_SHELL_SURFACE_RESIZE_LEFT;
 
 	shsurf->client->send_configure(shsurf->surface, edges,
-				       shsurf->output->current->width,
-				       shsurf->output->current->height - panel_height);
+				       shsurf->output->current->width +
+				       shsurf->surface->input.extents.x1 * 2,
+				       shsurf->output->current->height -
+				       panel_height +
+				       shsurf->surface->input.extents.y1 * 2);
 
 	shsurf->next_type = SHELL_SURFACE_MAXIMIZED;
 }
@@ -2673,9 +2676,10 @@ configure(struct desktop_shell *shell, struct weston_surface *surface,
 		break;
 	case SHELL_SURFACE_MAXIMIZED:
 		/* setting x, y and using configure to change that geometry */
-		surface->geometry.x = surface->output->x;
+		surface->geometry.x = surface->output->x - surface->input.extents.x1;
 		surface->geometry.y = surface->output->y +
-			get_output_panel_height(shell,surface->output);
+			get_output_panel_height(shell,surface->output -
+			surface->input.extents.y1);
 		break;
 	case SHELL_SURFACE_TOPLEVEL:
 		break;
-- 
1.7.11.2



More information about the wayland-devel mailing list