Skip to content

Commit

Permalink
Refactoring resizing into state machine.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexarian committed Mar 30, 2022
1 parent cd1af47 commit 03dff23
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 163 deletions.
38 changes: 27 additions & 11 deletions xrdp/xrdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,34 @@ 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_SERVER_MONITOR_RESIZE,
WMRZ_SERVER_VERSION_MESSAGE,
WMRZ_XRDP_CORE_RESIZE,
WMRZ_SERVER_INVALIDATE,
WMRZ_COMPLETE,
WMRZ_ERROR
};

#define XRDP_DISPLAY_RESIZE_STATE_TO_STR(status) \
((status) == WMRZ_QUEUED ? "QUEUED" : \
(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_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 03dff23

Please sign in to comment.