Resize state machine: A fix and a question (#2929)

* Store EGFX state before entering resize state machine

At present the EGFX state is destroyed by states WMRZ_EGFX_DELETE_SURFACE
through WRMZ_EGFX_DELETE. This means that at WMRZ_EGFX_INITIALIZE we
cannot distinguish between EGFX not being ever used, and EGFX
having been torn down. Consequently, when running non-GFX, we don't
correctly recover the session.

* Allow multiple reasons for suppress_output

Replaces the single boolean for suppress_output with
a bitmask, to allow output to be suppressed for
more than one reason

* Disable output during resize

* Add states to dynamic resize

Adds states to the dynamic resize state machine so we wait for a
Deactivation-Reactivation sequence to finish before sending pointer
updates, etc.

* suppress module output during the dynamic resize

* Add support for dynamic resize to VNC backend

xrdp_mm needs to be informed when a resize has been performed so that
the resize stte machine can be updsate.
This commit is contained in:
matt335672
2024-01-31 22:14:56 +00:00
committed by Christopher Pitstick
parent d9783a9529
commit 54acca43cf
9 changed files with 189 additions and 65 deletions
+29
View File
@@ -403,6 +403,20 @@ int
xrdp_sec_process_mcs_data_monitors(struct xrdp_sec *self, struct stream *s);
/* xrdp_rdp.c */
/**
* Reasons why output is being suppressed or restarted
*/
enum suppress_output_reason
{
/// Client has requested suppress via TS_SUPPRESS_OUTPUT_PDU
XSO_REASON_CLIENT_REQUEST = (1 << 0),
/// Deactivation-Reactivation Sequence [MS-RDPBCGR] 1.3.1.3
XSO_REASON_DEACTIVATE_REACTIVATE = (1 << 1),
/// Dynamic resize in progress
XSO_REASON_DYNAMIC_RESIZE = (1 << 2)
};
struct xrdp_rdp *
xrdp_rdp_create(struct xrdp_session *session, struct trans *trans);
void
@@ -438,6 +452,21 @@ xrdp_rdp_send_deactivate(struct xrdp_rdp *self);
int
xrdp_rdp_send_session_info(struct xrdp_rdp *self, const char *data,
int data_bytes);
/**
* Request output suppress or resume
*
* @param self RDP struct
* @param suppress (!= 0 for suppress, 0 for resume)
* @param reason Why the output is being suppressed or resumed
* @param left Left pixel of repaint area (ignored for suppress)
* @param top Top pixel of repaint area (ignored for suppress)
* @param right Right pixel of inclusive repaint area (ignored for suppress)
* @param bottom Bottom pixel of inclusive repaint area (ignored for suppress)
*/
void
xrdp_rdp_suppress_output(struct xrdp_rdp *self, int suppress,
enum suppress_output_reason reason,
int left, int top, int right, int bottom);
/* xrdp_orders.c */
struct xrdp_orders *