From 00de8ceff7271f90bae845f93c7ea138669dfb74 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 3 Aug 2022 09:45:30 -0500 Subject: [PATCH] rdp: Use the first output in rdp_peer_refresh_region Currently, this is what backend->output would be anyway. This is another step towards removing the singleton output stored in the backend. Signed-off-by: Derek Foreman --- libweston/backend-rdp/rdp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c index 0d19af15..9232b625 100644 --- a/libweston/backend-rdp/rdp.c +++ b/libweston/backend-rdp/rdp.c @@ -53,6 +53,21 @@ extern PWtsApiFunctionTable FreeRDP_InitWtsApi(void); +static struct rdp_output * +rdp_get_first_output(struct rdp_backend *b) +{ + struct weston_output *output; + struct rdp_output *rdp_output; + + wl_list_for_each(output, &b->compositor->output_list, link) { + rdp_output = to_rdp_output(output); + if (rdp_output) + return rdp_output; + } + + return NULL; +} + static void rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_peer *peer) { @@ -226,7 +241,7 @@ static void rdp_peer_refresh_region(pixman_region32_t *region, freerdp_peer *peer) { RdpPeerContext *context = (RdpPeerContext *)peer->context; - struct rdp_output *output = context->rdpBackend->output; + struct rdp_output *output = rdp_get_first_output(context->rdpBackend); rdpSettings *settings = peer->context->settings; if (settings->RemoteFxCodec)