From ddcbb46f9740425910cccdede374f41a3bee2dd7 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 3 Feb 2023 12:07:50 +0100 Subject: [PATCH] xwayland: Tell RR has changed only when done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Michel Dänzer --- hw/xwayland/xwayland-output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 7a9352f58..24c554b57 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -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...