[PATCH weston v2 05/21] desktop-shell: Track the black surface by its view

Arnaud Vrac rawoul at gmail.com
Fri May 29 08:07:08 PDT 2015


Hi Jonas,

This patch makes the black_surface_get_label function crash. The black surface should track the fullscreen view in the configure_private field instead of the black surface view.

See the attached patch for reference.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-desktop-shell-track-fullscreen-view-in-black-surface.patch
Type: application/octet-stream
Size: 2002 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150529/9cebf07a/attachment.obj>
-------------- next part --------------


> On 13 mai 2015, at 12:26, Jonas Ådahl <jadahl at gmail.com> wrote:
> 
> In preparation for further refactoring.
> 
> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
> ---
> desktop-shell/shell.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 1ac1340..efa6ac4 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -2843,7 +2843,7 @@ create_black_surface(struct weston_compositor *ec,
> 	}
> 
> 	surface->configure = black_surface_configure;
> -	surface->configure_private = fs_surface;
> +	surface->configure_private = view;
> 	weston_surface_set_label_func(surface, black_surface_get_label);
> 	weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1);
> 	pixman_region32_fini(&surface->opaque);
> @@ -5140,11 +5140,13 @@ black_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
> }
> 
> static bool
> -is_black_surface (struct weston_surface *es, struct weston_surface **fs_surface)
> +is_black_surface(struct weston_view *view, struct weston_view **fs_view)
> {
> +	struct weston_surface *es = view->surface;
> +
> 	if (es->configure == black_surface_configure) {
> -		if (fs_surface)
> -			*fs_surface = (struct weston_surface *)es->configure_private;
> +		if (fs_view)
> +			*fs_view = (struct weston_view *) es->configure_private;
> 		return true;
> 	}
> 	return false;
> @@ -5155,21 +5157,20 @@ activate_binding(struct weston_seat *seat,
> 		 struct desktop_shell *shell,
> 		 struct weston_view *focus_view)
> {
> -	struct weston_surface *focus;
> +	struct weston_view *main_view;
> 	struct weston_surface *main_surface;
> 
> 	if (!focus_view)
> 		return;
> -	focus = focus_view->surface;
> 
> -	if (is_black_surface(focus, &main_surface))
> -		focus = main_surface;
> +	if (is_black_surface(focus_view, &main_view))
> +		focus_view = main_view;
> 
> -	main_surface = weston_surface_get_main_surface(focus);
> +	main_surface = weston_surface_get_main_surface(focus_view->surface);
> 	if (get_shell_surface_type(main_surface) == SHELL_SURFACE_NONE)
> 		return;
> 
> -	activate(shell, focus, seat, true);
> +	activate(shell, focus_view->surface, seat, true);
> }
> 
> static void
> @@ -6054,7 +6055,7 @@ switcher_next(struct switcher *switcher)
> 			weston_surface_damage(view->surface);
> 		}
> 
> -		if (is_black_surface(view->surface, NULL)) {
> +		if (is_black_surface(view, NULL)) {
> 			view->alpha = 0.25;
> 			weston_view_geometry_dirty(view);
> 			weston_surface_damage(view->surface);
> -- 
> 2.1.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list