On Mon, Mar 05, 2012 at 02:13:13PM +0800, [email protected] wrote:
> From: Alex Wu <[email protected]>
>
> This can happen for instance running a toytoolkit application, launching
> the popup menu and then clicking on a surface that does not belong to
> the client that create the popup surface.
Thanks. I applied it but edited is slightly to just return early if
focus is NULL.
Kristian
> ---
> src/shell.c | 15 +++++++++------
> 1 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/src/shell.c b/src/shell.c
> index ac7301a..86edaf6 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -1414,12 +1414,15 @@ click_to_activate_binding(struct wl_input_device
> *device,
> struct weston_surface *upper;
>
> focus = (struct weston_surface *) device->pointer_focus;
> - upper = container_of(focus->link.prev, struct weston_surface, link);
> - if (focus->link.prev != &compositor->surface_list &&
> - get_shell_surface_type(upper) == SHELL_SURFACE_FULLSCREEN) {
> - printf("%s: focus is black surface, raise its fullscreen
> surface\n", __func__);
> - shell_stack_fullscreen(get_shell_surface(upper));
> - focus = upper;
> +
> + if (focus) {
> + upper = container_of(focus->link.prev, struct weston_surface,
> link);
> + if (focus->link.prev != &compositor->surface_list &&
> + get_shell_surface_type(upper) == SHELL_SURFACE_FULLSCREEN) {
> + printf("%s: focus is black surface, raise its
> fullscreen surface\n", __func__);
> + shell_stack_fullscreen(get_shell_surface(upper));
> + focus = upper;
> + }
> }
>
> if (state && focus && device->pointer_grab ==
> &device->default_pointer_grab)
> --
> 1.7.5.4
>
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel