[PATCH] client: don't call drag_offer_handler if it not hooked

Kristian Høgsberg krh at bitplanet.net
Mon Nov 22 10:08:26 PST 2010


On Fri, Nov 12, 2010 at 8:18 PM, wucan <canbaby at 21cn.com> wrote:
> When play with dnd and terminal, if you drag any item in dnd to
> terminal,terminal segvment fault. It's because terminal not setup
> drag_offer_handler, but when a item draged on it's window,
> display_handle_global() trigger the handler.

Yup, thanks.  I just rolled this and the follow-on patch into one.

Kristian

> ---
>  clients/window.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/clients/window.c b/clients/window.c
> index 9dfd355..5f69561 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -1329,7 +1329,9 @@ display_handle_global(struct wl_display *display,
> uint32_t id,
>                d->shm = wl_shm_create(display, id);
>        } else if (strcmp(interface, "drag_offer") == 0) {
>                offer = wl_drag_offer_create(display, id);
> -               d->drag_offer_handler(offer, d);
> +               if (d->drag_offer_handler) {
> +                       d->drag_offer_handler(offer, d);
> +               }
>        }
>  }
>
> --
> 1.6.4.GIT
> --
> wucan
> _______________________________________________
> 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