xwayland: Tell RR has changed only when done

Since commit 204f10c2, we notify XRandR clients that the randr
configuration has changes as soon as an new output is created.

Yet, this might be premature, considering that at that point, we are
still to receive the wl_output and xdg-output events that will most
likely change the setup.

So instead of calling RRTellChanged() from xwl_output_create(), wait
until we get to call apply_output_change(), which occurs after the done
events from both xdg-output and wl_output are received.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
Olivier Fourdan 2023-02-03 12:07:50 +01:00
parent 5aebc01096
commit ddcbb46f97

View File

@ -654,6 +654,8 @@ apply_output_change(struct xwl_output *xwl_output)
if (xwl_screen->fixed_output == NULL)
update_screen_size(xwl_screen, width, height);
else
RRTellChanged(xwl_screen->screen);
}
static void
@ -814,7 +816,6 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id, Bool with_xrandr)
RRCrtcGammaSetSize(xwl_output->randr_crtc, 256);
RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc, 1);
RROutputSetConnection(xwl_output->randr_output, RR_Connected);
RRTellChanged(xwl_screen->screen);
}
/* We want the output to be in the list as soon as created so we can
* use it when binding to the xdg-output protocol...