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,