[PATCH] shell: Don't try to switch to a NULL shell surface.
Kristian Høgsberg
hoegsberg at gmail.com
Thu Dec 5 15:58:22 PST 2013
On Thu, Dec 05, 2013 at 07:01:21PM -0200, Rafael Antognolli wrote:
> Fixes the crash from alt+tab when there's a fullscreen surface.
> ---
> desktop-shell/shell.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 0b6a97c..18b88f4 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -5174,6 +5174,8 @@ switcher_next(struct switcher *switcher)
>
> wl_list_for_each(view, &ws->layer.view_list, layer_link) {
> shsurf = get_shell_surface(view->surface);
> + if (!shsurf)
> + break;
This will break out of the loop. We're trying to loop through all
surfaces to find the next one for alt tab so we need to keep going.
We can't continue, since we need to hit the is_black_surface() case
below. I rewrote the switch() to just be:
if (shsurf &&
shsurf->type == SHELL_SURFACE_TOPLEVEL &&
shsurf->parent == NULL) {
since that's the only case we care about after removing all the other
surface types.
Kristian
> switch (shsurf->type) {
> case SHELL_SURFACE_TOPLEVEL:
> if (shsurf->parent)
> --
> 1.8.3.1
>
> _______________________________________________
> 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