[PATCH 2/6] compositor: Remove the edges parameter from send_configure

Jasper St. Pierre jstpierre at mecheye.net
Mon Apr 28 08:19:28 PDT 2014


send_configure was originally modelled after
wl_shell_surface::send_configure, which takes these arguments. However,
the X WM and xdg_surface::configure variants don't use these arguments.

We already store the resize edges for a surface while it's being
resized, so just use the saved state in the wl_shell_surface variant.
---
 desktop-shell/shell.c     | 20 +++++++++-----------
 src/compositor.h          |  3 +--
 xwayland/window-manager.c |  3 +--
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index bc4a258..3dc45b7 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1617,20 +1617,19 @@ resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
 		height += wl_fixed_to_int(to_y - from_y);
 	}
 
-	shsurf->client->send_configure(shsurf->surface,
-				       resize->edges, width, height);
+	shsurf->client->send_configure(shsurf->surface, width, height);
 }
 
 static void
-send_configure(struct weston_surface *surface,
-	       uint32_t edges, int32_t width, int32_t height)
+send_configure(struct weston_surface *surface, int32_t width, int32_t height)
 {
 	struct shell_surface *shsurf = get_shell_surface(surface);
 
 	assert(shsurf);
 
 	wl_shell_surface_send_configure(shsurf->resource,
-					edges, width, height);
+					shsurf->resize_edges,
+					width, height);
 }
 
 static const struct weston_shell_client shell_client = {
@@ -2311,7 +2310,7 @@ set_fullscreen(struct shell_surface *shsurf,
 
 	shsurf->type = SHELL_SURFACE_TOPLEVEL;
 
-	shsurf->client->send_configure(shsurf->surface, 0,
+	shsurf->client->send_configure(shsurf->surface,
 				       shsurf->output->width,
 				       shsurf->output->height);
 
@@ -2425,15 +2424,14 @@ set_maximized(struct shell_surface *shsurf,
               struct weston_output *output)
 {
 	struct desktop_shell *shell;
-	uint32_t edges = 0, panel_height = 0;
+	uint32_t panel_height = 0;
 
 	shell_surface_set_output(shsurf, output);
 
 	shell = shell_surface_get_shell(shsurf);
 	panel_height = get_output_panel_height(shell, shsurf->output);
-	edges = WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT;
 
-	shsurf->client->send_configure(shsurf->surface, edges,
+	shsurf->client->send_configure(shsurf->surface,
 	                               shsurf->output->width,
 	                               shsurf->output->height - panel_height);
 
@@ -3442,7 +3440,7 @@ static const struct xdg_surface_interface xdg_surface_implementation = {
 
 static void
 xdg_send_configure(struct weston_surface *surface,
-	       uint32_t edges, int32_t width, int32_t height)
+		   int32_t width, int32_t height)
 {
 	struct shell_surface *shsurf = get_shell_surface(surface);
 
@@ -3540,7 +3538,7 @@ static const struct xdg_popup_interface xdg_popup_implementation = {
 
 static void
 xdg_popup_send_configure(struct weston_surface *surface,
-			 uint32_t edges, int32_t width, int32_t height)
+			 int32_t width, int32_t height)
 {
 }
 
diff --git a/src/compositor.h b/src/compositor.h
index c913f54..81e541b 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -82,8 +82,7 @@ struct weston_mode {
 };
 
 struct weston_shell_client {
-	void (*send_configure)(struct weston_surface *surface,
-			       uint32_t edges, int32_t width, int32_t height);
+	void (*send_configure)(struct weston_surface *surface, int32_t width, int32_t height);
 };
 
 struct weston_shell_interface {
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 699bade..44ce60c 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -2139,8 +2139,7 @@ weston_wm_window_configure(void *data)
 }
 
 static void
-send_configure(struct weston_surface *surface,
-	       uint32_t edges, int32_t width, int32_t height)
+send_configure(struct weston_surface *surface, int32_t width, int32_t height)
 {
 	struct weston_wm_window *window = get_wm_window(surface);
 	struct weston_wm *wm = window->wm;
-- 
1.9.0



More information about the wayland-devel mailing list