[PATCH weston] compositor-wayland: Handle window close events more gracefully

Dima Ryazanov dima at gmail.com
Wed May 20 00:55:26 PDT 2015


On Tue, May 19, 2015 at 11:35 PM, Pekka Paalanen <ppaalanen at gmail.com>
wrote:

> On Tue, 19 May 2015 16:41:19 -0700
> Bryce Harrington <bryce at osg.samsung.com> wrote:
>
> > On Mon, May 18, 2015 at 11:14:16PM -0700, Dima Ryazanov wrote:
> > > When a compositor window is closed, remove the output instead of just
> exiting.
> > >
> > > (The "if (!input->output)" checks are kind of ugly - but I couldn't
> find
> > > a better way to handle the output going away.)
> > >
> > > Signed-off-by: Dima Ryazanov <dima at gmail.com>
> > Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
>
> Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
>
> If someone tests this patch (maybe Bryce already did?) that it doesn't
> cause any harm wrt. closing compositor windows in single and multi
> window cases, then I think this is suitable to go in before RC2. After
> RC2 not so much.
>
> > > @@ -1384,8 +1393,15 @@ input_handle_button(void *data, struct
> wl_pointer *pointer,
> > >                     return;
> > >             }
> > >
> > > -           if (frame_status(input->output->frame) &
> FRAME_STATUS_CLOSE)
> > > -
>  wl_display_terminate(input->compositor->base.wl_display);
> > > +           if (frame_status(input->output->frame) &
> FRAME_STATUS_CLOSE) {
> > > +                   wayland_output_destroy(&input->output->base);
> > > +                   input->output = input->keyboard_focus = NULL;
>
> Please don't do multi-assignments like this, it's too easy to miss one
> of them when reading. Also setting output to keyboard_focus is strange
> to begin with, which is how I'd carelessly read this and go wtf.
>

Haha ok, I'll send out a fix.

Thanks,
> pq
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150520/6327a3ae/attachment.html>


More information about the wayland-devel mailing list