[PATCH v2 1/3] xwayland: Fix the addition and removal of outputs
Marek Chalupa
mchqwerty at gmail.com
Thu May 21 06:18:42 PDT 2015
Hi,
On Sat, May 16, 2015 at 7:38 AM, Dima Ryazanov <dima at gmail.com> wrote:
> Add the output to the list when it's created rather than when its
> properties
> change (as pointed out by Marek Chalupa).
> Remove the output from the list when it's destroyed.
>
> Signed-off-by: Dima Ryazanov <dima at gmail.com>
> ---
> hw/xwayland/xwayland-output.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
> index 155cbc1..9baf4eb 100644
> --- a/hw/xwayland/xwayland-output.c
> +++ b/hw/xwayland/xwayland-output.c
> @@ -120,8 +120,6 @@ output_handle_done(void *data, struct wl_output
> *wl_output)
> struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
> int width, height;
>
> - xorg_list_append(&xwl_output->link, &xwl_screen->output_list);
> -
>
As I pointed out in the other e-mail: I don't think this is right. The
append is here on purpose to make the output update atomic.
But maybe somebody more erudated should review it :)
> width = 0;
> height = 0;
> xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) {
> @@ -177,6 +175,8 @@ xwl_output_create(struct xwl_screen *xwl_screen,
> uint32_t id)
> xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output);
> xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name,
> strlen(name), xwl_output);
> + xorg_list_append(&xwl_output->link, &xwl_screen->output_list);
> +
> RRCrtcGammaSetSize(xwl_output->randr_crtc, 256);
> RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc,
> 1);
> RROutputSetConnection(xwl_output->randr_output, RR_Connected);
> @@ -190,6 +190,7 @@ xwl_output_destroy(struct xwl_output *xwl_output)
> wl_output_destroy(xwl_output->output);
> RRCrtcDestroy(xwl_output->randr_crtc);
> RROutputDestroy(xwl_output->randr_output);
> + xorg_list_del(&xwl_output->link);
> free(xwl_output);
> }
>
> --
> 2.4.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150521/43761719/attachment-0001.html>
More information about the wayland-devel
mailing list