[PATCH 03/16] shell: Change set_maximized to receive internal structures.
Rafael Antognolli
antognolli at gmail.com
Tue Dec 3 09:43:56 PST 2013
On Fri, Nov 29, 2013 at 9:02 PM, Kristian Høgsberg <hoegsberg at gmail.com> wrote:
> On Wed, Nov 27, 2013 at 03:50:19PM -0200, Rafael Antognolli wrote:
>> 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;
>
> I was going to say that these details should be in set_maximized(),
> but resetting the state is part of wl_shell semantics and should stay
> here. This patch is good to go, but depends on previous patch.
This commit disappears, thanks to Philip Withnall's patches.
>> +
>> + if (output_resource)
>> + output = wl_resource_get_user_data(output_resource);
>> + else
>> + output = NULL;
>> + set_maximized(shsurf, output);
>> }
>>
>> static void
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
--
Rafael Antognolli
More information about the wayland-devel
mailing list