From b02ffbd244efab2a09c67d5fafcaad2f3c050b94 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 3 Aug 2022 11:38:55 -0500 Subject: [PATCH] rdp: Remove singleton output tracking We don't need this anymore. Since we only support one output, we can use the first output for any place we used to use it. Signed-off-by: Derek Foreman --- libweston/backend-rdp/rdp.c | 14 ++++---------- libweston/backend-rdp/rdp.h | 3 --- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c index 52dc6165d..dcff549a1 100644 --- a/libweston/backend-rdp/rdp.c +++ b/libweston/backend-rdp/rdp.c @@ -485,8 +485,6 @@ rdp_output_enable(struct weston_output *base) loop = wl_display_get_event_loop(b->compositor->wl_display); output->finish_frame_timer = wl_event_loop_add_timer(loop, finish_frame_handler, output); - b->output = output; - return 0; } @@ -494,12 +492,9 @@ static int rdp_output_disable(struct weston_output *base) { struct rdp_output *output = to_rdp_output(base); - struct rdp_backend *b; assert(output); - b = to_rdp_backend(base->compositor); - if (!output->base.enabled) return 0; @@ -507,7 +502,6 @@ rdp_output_disable(struct weston_output *base) pixman_renderer_output_destroy(&output->base); wl_event_source_remove(output->finish_frame_timer); - b->output = NULL; return 0; } @@ -978,7 +972,7 @@ xf_peer_activate(freerdp_peer* client) peerCtx = (RdpPeerContext *)client->context; b = peerCtx->rdpBackend; peersItem = &peerCtx->item; - output = b->output; + output = rdp_get_first_output(b); settings = client->context->settings; if (!settings->SurfaceCommandsEnabled) { @@ -1276,7 +1270,7 @@ xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) * the RDP client. */ if (!(flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL))) { - output = peerContext->rdpBackend->output; + output = rdp_get_first_output(peerContext->rdpBackend); if (x < output->base.width && y < output->base.height) { weston_compositor_get_time(&time); notify_motion_absolute(peerContext->item.seat, &time, @@ -1352,7 +1346,7 @@ xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) need_frame = true; } - output = peerContext->rdpBackend->output; + output = rdp_get_first_output(peerContext->rdpBackend); if (x < output->base.width && y < output->base.height) { weston_compositor_get_time(&time); notify_motion_absolute(peerContext->item.seat, &time, x, y); @@ -1372,7 +1366,7 @@ xf_input_synchronize_event(rdpInput *input, UINT32 flags) freerdp_peer *client = input->context->peer; RdpPeerContext *peerCtx = (RdpPeerContext *)input->context; struct rdp_backend *b = peerCtx->rdpBackend; - struct rdp_output *output = peerCtx->rdpBackend->output; + struct rdp_output *output = rdp_get_first_output(b); struct weston_keyboard *keyboard; pixman_box32_t box; pixman_region32_t damage; diff --git a/libweston/backend-rdp/rdp.h b/libweston/backend-rdp/rdp.h index 546b3f18f..b7143bcbb 100644 --- a/libweston/backend-rdp/rdp.h +++ b/libweston/backend-rdp/rdp.h @@ -67,15 +67,12 @@ #define ATKBD_RET_HANJA 0xf1 #define ATKBD_RET_HANGEUL 0xf2 -struct rdp_output; - struct rdp_backend { struct weston_backend base; struct weston_compositor *compositor; freerdp_listener *listener; struct wl_event_source *listener_events[MAX_FREERDP_FDS]; - struct rdp_output *output; struct weston_log_scope *debug; struct weston_log_scope *verbose;