From a5975210f0fab2b9d0cb7297ced91762770966d9 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Mon, 20 Jul 2026 09:51:14 +0100 Subject: [PATCH] code quality: Forward-port code comments Minor change to the GFX resize state machine following review comments on backport to v0.10: https://github.com/neutrinolabs/xrdp/pull/3834 There are no functional changes as a result of this commit (cherry picked from commit a2fd7b7ef7c7f7c67b429634d2a1749492198cf2) --- xrdp/xrdp_egfx.c | 2 ++ xrdp/xrdp_mm.c | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/xrdp/xrdp_egfx.c b/xrdp/xrdp_egfx.c index e9e41678..255f7646 100644 --- a/xrdp/xrdp_egfx.c +++ b/xrdp/xrdp_egfx.c @@ -936,6 +936,8 @@ xrdp_egfx_open_response(struct xrdp_process *id, int chan_id, static int xrdp_egfx_close_response(struct xrdp_process *id, int chan_id) { + UNUSED_VAR(id); + UNUSED_VAR(chan_id); LOG(LOG_LEVEL_TRACE, "xrdp_egfx_close_response:"); return 0; } diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 5c0d7385..0c3b7306 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1796,17 +1796,7 @@ process_display_control_monitor_layout_data(struct xrdp_wm *wm) break; case WMRZ_ENCODER_CREATE: - if (mm->egfx_up) - { - xrdp_mm_egfx_create_surfaces(mm); - } - mm->encoder = xrdp_encoder_create(mm); - - // Ack all frames to speed up resize. - module->mod_frame_ack(module, 0, INT_MAX); - - // Restart module output after resizing and invalidating - // the screen. This causes an automatic redraw. + // Resize the screen to the target size error = xrdp_bitmap_resize( wm->screen, desc_width, desc_height); if (error != 0) @@ -1816,6 +1806,18 @@ process_display_control_monitor_layout_data(struct xrdp_wm *wm) " xrdp_bitmap_resize failed %d", error); return advance_error(error, mm); } + + // Create the encoder and surfaces + if (mm->egfx_up) + { + xrdp_mm_egfx_create_surfaces(mm); + } + mm->encoder = xrdp_encoder_create(mm); + + // Ack all frames to speed up resize. + module->mod_frame_ack(module, 0, INT_MAX); + + // Redraw the screen xrdp_bitmap_invalidate(wm->screen, 0); xrdp_rdp_suppress_output(wm->session->rdp, 0, XSO_REASON_DYNAMIC_RESIZE,