Skip to content

Commit

Permalink
Refactoring resizing into state machine.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Nexarian committed Mar 31, 2022
1 parent cd1af47 commit e09a814
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 157 deletions.
42 changes: 31 additions & 11 deletions xrdp/xrdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,38 @@ xrdp_bitmap_compress(char *in_data, int width, int height,

/* xrdp_mm.c */

struct dynamic_monitor_layout
enum display_resize_state
{
int flags;
int left;
int top;
int width;
int height;
int physical_width;
int physical_height;
int orientation;
int desktop_scale_factor;
int device_scale_factor;
WMRZ_QUEUED = 0,
WMRZ_ENCODER_DELETE,
WMRZ_SERVER_MONITOR_RESIZE,
WMRZ_SERVER_VERSION_MESSAGE,
WMRZ_XRDP_CORE_RESIZE,
WMRZ_ENCODER_CREATE,
WMRZ_SERVER_INVALIDATE,
WMRZ_COMPLETE,
WMRZ_ERROR
};

#define XRDP_DISPLAY_RESIZE_STATE_TO_STR(status) \
((status) == WMRZ_QUEUED ? "QUEUED" : \
(status) == WMRZ_ENCODER_DELETE ? "WMRZ_ENCODER_DELETE" : \
(status) == WMRZ_SERVER_MONITOR_RESIZE ? "SERVER_MONITOR_RESIZE" : \
(status) == WMRZ_SERVER_VERSION_MESSAGE ? "SERVER_VERSION_MESSAGE" : \
(status) == WMRZ_XRDP_CORE_RESIZE ? "XRDP_CORE_RESIZE" : \
(status) == WMRZ_ENCODER_CREATE ? "WMRZ_ENCODER_CREATE" : \
(status) == WMRZ_SERVER_INVALIDATE ? "SERVER_INVALIDATE" : \
(status) == WMRZ_COMPLETE ? "COMPLETE" : \
(status) == WMRZ_ERROR ? "ERROR" : \
"unknown" \
)

struct dynamic_monitor_description
{
struct display_size_description description;
enum display_resize_state state;
int last_state_update_timestamp;
int start_time;
};

int
Expand Down
Loading

0 comments on commit e09a814

Please sign in to comment.