[PATCH weston v6 2/2] window : compare version and call appropriate destructor

Giulio Camuffo giuliocamuffo at gmail.com
Mon Oct 20 08:41:05 PDT 2014


2014-10-20 14:35 GMT+03:00 Kabeer Ahmed Khan <kabeer.khan at samsung.com>:

>  Hey Giulio
>
> Thank You for your comments.I am already doing
>
> d->data_device_manager_version = MIN(version, 2);
>
>
>
> So comparing version while binding shouldn't be necessary.
>
> Thank You
>

Ah right, sorry.

>
>
> ------- *Original Message* -------
>
> *Sender* : Giulio Camuffo<giuliocamuffo at gmail.com>
>
> *Date* : Oct 20, 2014 13:31 (GMT+05:30)
>
> *Title* : Re: [PATCH weston v6 2/2] window : compare version and call
> appropriate destructor
>
>
> 2014-10-20 9:25 GMT+03:00  :
> > From: kabeer khan
> >
> > Signed-off-by: kabeer khan
> > ---
> >  clients/window.c | 15 ++++++++++-----
> >  1 file changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/clients/window.c b/clients/window.c
> > index 139c7f9..c8ed9a2 100644
> > --- a/clients/window.c
> > +++ b/clients/window.c
> > @@ -133,6 +133,7 @@ struct display {
> >
> >         int has_rgb565;
> >         int seat_version;
> > +       int data_device_manager_version;
> >  };
> >
> >  struct window_output {
> > @@ -5148,9 +5149,12 @@ input_destroy(struct input *input)
> >         if (input->selection_offer)
> >                 data_offer_destroy(input->selection_offer);
> >
> > -       if (input->data_device)
> > -               wl_data_device_destroy(input->data_device);
> > -
> > +       if (input->data_device) {
> > +               if(input->display->data_device_manager_version >= 2)
> > +                       wl_data_device_release(input->data_device);
> > +               else
> > +                       wl_data_device_destroy(input->data_device);
> > +       }
> >         if (input->display->seat_version >= 3) {
> >                 if (input->pointer)
> >                         wl_pointer_release(input->pointer);
> > @@ -5234,9 +5238,10 @@ registry_handle_global(void *data, struct
> wl_registry *registry, uint32_t id,
> >                 d->shm = wl_registry_bind(registry, id,
> &wl_shm_interface, 1);
> >                 wl_shm_add_listener(d->shm, &shm_listener, d);
> >         } else if (strcmp(interface, "wl_data_device_manager") == 0) {
> > +               d->data_device_manager_version = MIN(version, 2);
> >                 d->data_device_manager =
> > -                       wl_registry_bind(registry, id,
> >
> -                                        &wl_data_device_manager_interface,
> 1);
> > +                       wl_registry_bind(registry, id,
> >
> +                                        &wl_data_device_manager_interface,
> d->data_device_manager_version);
>
> The version used here should be MIN(d->data_device_manager_version,
> version)
>
>
> >         } else if (strcmp(interface, "xdg_shell") == 0) {
> >                 d->xdg_shell = wl_registry_bind(registry, id,
> >                                                 &xdg_shell_interface, 1);
> > --
> > 2.1.0
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>
>
>
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20141020/8d58a607/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 201410201705060_4XEV4D4T.gif
Type: image/gif
Size: 13168 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20141020/8d58a607/attachment-0001.gif>


More information about the wayland-devel mailing list