[PATCH 03/16] shell: Change set_maximized to receive internal structures.

Rafael Antognolli rafael.antognolli at intel.com
Wed Nov 27 09:50:19 PST 2013


Change the parameters of set_maximized from wl_resource and wl_client to
shell_surface and weston_output. This will allow it to be used with
xdg-shell too.
---
 src/shell.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index cf89a84..507d46f 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2204,19 +2204,17 @@ get_output_panel_height(struct desktop_shell *shell,
 }
 
 static void
-set_maximized(struct wl_client *client,
-	      struct wl_resource *resource,
-	      struct wl_resource *output_resource)
+set_maximized(struct shell_surface *shsurf,
+	      struct weston_output *output)
 {
-	struct shell_surface *shsurf = wl_resource_get_user_data(resource);
 	struct weston_surface *es = shsurf->surface;
 	struct desktop_shell *shell = NULL;
 	uint32_t edges = 0, panel_height = 0;
 
 	/* get the default output, if the client set it as NULL
 	   check whether the ouput is available */
-	if (output_resource)
-		shsurf->output = wl_resource_get_user_data(output_resource);
+	if (output)
+		shsurf->output = output;
 	else if (es->output)
 		shsurf->output = es->output;
 	else
@@ -2239,10 +2237,17 @@ shell_surface_set_maximized(struct wl_client *client,
 			    struct wl_resource *output_resource)
 {
 	struct shell_surface *shsurf = wl_resource_get_user_data(resource);
+	struct weston_output *output;
+
 	surface_clear_next_states(shsurf);
-	set_maximized(client, resource, output_resource);
 	shsurf->next.maximized = true;
 	shsurf->state_changed = true;
+
+	if (output_resource)
+		output = wl_resource_get_user_data(output_resource);
+	else
+		output = NULL;
+	set_maximized(shsurf, output);
 }
 
 static void
-- 
1.8.3.1



More information about the wayland-devel mailing list