[PATCH 1/2] xwayland/window-manager.c: Use container_of to get the wm pointer since window may be NULL.

Kristian Høgsberg hoegsberg at gmail.com
Tue May 22 08:35:04 PDT 2012


On Mon, May 21, 2012 at 03:49:13PM -0600, Scott Moreau wrote:

Ah, doh, yes.  Thanks.
Kristian

> ---
>  src/xwayland/window-manager.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
> index b05f4ac..b64a6e5 100644
> --- a/src/xwayland/window-manager.c
> +++ b/src/xwayland/window-manager.c
> @@ -456,7 +456,7 @@ weston_wm_window_activate(struct wl_listener *listener, void *data)
>  {
>  	struct weston_surface *surface = data;
>  	struct weston_wm_window *window = get_wm_window(surface);
> -	struct weston_wm *wm = window->wm;
> +	struct weston_wm *wm = container_of(listener, struct weston_wm, activate_listener);
>  
>  	if (window)
>  		weston_wm_activate(wm, window, XCB_TIME_CURRENT_TIME);
> -- 
> 1.7.7.6
> 
> _______________________________________________
> 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