Skip to content

Commit e09a814

Browse files
committed
Refactoring resizing into state machine.
- Fixes MSTSC resizing (with RFX as well). - Queue system so that resizes are processed when XRDP and the X server are ready, not immediately. - Deletes and recreates the encoder (RFX fix) - Introduces a dynamic_monitor_description struct that is used for the queue system.
1 parent cd1af47 commit e09a814

File tree

4 files changed

+301
-157
lines changed

4 files changed

+301
-157
lines changed

xrdp/xrdp.h

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -397,18 +397,38 @@ xrdp_bitmap_compress(char *in_data, int width, int height,
397397

398398
/* xrdp_mm.c */
399399

400-
struct dynamic_monitor_layout
400+
enum display_resize_state
401401
{
402-
int flags;
403-
int left;
404-
int top;
405-
int width;
406-
int height;
407-
int physical_width;
408-
int physical_height;
409-
int orientation;
410-
int desktop_scale_factor;
411-
int device_scale_factor;
402+
WMRZ_QUEUED = 0,
403+
WMRZ_ENCODER_DELETE,
404+
WMRZ_SERVER_MONITOR_RESIZE,
405+
WMRZ_SERVER_VERSION_MESSAGE,
406+
WMRZ_XRDP_CORE_RESIZE,
407+
WMRZ_ENCODER_CREATE,
408+
WMRZ_SERVER_INVALIDATE,
409+
WMRZ_COMPLETE,
410+
WMRZ_ERROR
411+
};
412+
413+
#define XRDP_DISPLAY_RESIZE_STATE_TO_STR(status) \
414+
((status) == WMRZ_QUEUED ? "QUEUED" : \
415+
(status) == WMRZ_ENCODER_DELETE ? "WMRZ_ENCODER_DELETE" : \
416+
(status) == WMRZ_SERVER_MONITOR_RESIZE ? "SERVER_MONITOR_RESIZE" : \
417+
(status) == WMRZ_SERVER_VERSION_MESSAGE ? "SERVER_VERSION_MESSAGE" : \
418+
(status) == WMRZ_XRDP_CORE_RESIZE ? "XRDP_CORE_RESIZE" : \
419+
(status) == WMRZ_ENCODER_CREATE ? "WMRZ_ENCODER_CREATE" : \
420+
(status) == WMRZ_SERVER_INVALIDATE ? "SERVER_INVALIDATE" : \
421+
(status) == WMRZ_COMPLETE ? "COMPLETE" : \
422+
(status) == WMRZ_ERROR ? "ERROR" : \
423+
"unknown" \
424+
)
425+
426+
struct dynamic_monitor_description
427+
{
428+
struct display_size_description description;
429+
enum display_resize_state state;
430+
int last_state_update_timestamp;
431+
int start_time;
412432
};
413433

414434
int

0 commit comments

Comments
 (0)