Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/xrdp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristopher Pitstick <cmp@pitstick.net>2021-05-25 07:05:54 +0300
committerChristopher Pitstick <cmp@pitstick.net>2022-03-27 06:45:16 +0300
commit4a0db63be7b42c887379c3ef574e71112c8fd427 (patch)
tree730a8e4f2c6f244dc516b07baa2effb0f2fc3e48 /common
parentf3c37e2694c7fc09e6240b9b68f7cf6c86a47445 (diff)
Unify monitor processing logic.
There are two places where monitor descriptions are passed through the RDP protocol: - TS_UD_CS_MONITOR ([MS-RDPBCGR] 2.2.1.3.6 Client Monitor Data) - DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT ([MS-RDPEDISP] 2.2.2.2) The processing logic for both of them is similar enough that they should be unified. Also update to define the constants for the maximum and minimum desktop width/height for monitors and total area. Also a large number of clarifications for the constants and protocol requirements. Note that this is also the first step to making resizing work with the extension GFX channel as well as an important foundational step to enable HiDPI compatibility. Also some misc logging updates.
Diffstat (limited to 'common')
-rw-r--r--common/ms-rdpbcgr.h18
-rw-r--r--common/ms-rdpedisp.h16
-rw-r--r--common/xrdp_client_info.h25
3 files changed, 55 insertions, 4 deletions
diff --git a/common/ms-rdpbcgr.h b/common/ms-rdpbcgr.h
index 813dc4db..e993c270 100644
--- a/common/ms-rdpbcgr.h
+++ b/common/ms-rdpbcgr.h
@@ -83,10 +83,24 @@
#define RDPSND_SVC_CHANNEL_NAME "rdpsnd"
#define RDPDR_SVC_CHANNEL_NAME "rdpdr"
-/* 2.2.1.3.6 Client Monitor Data - */
+/* 2.2.1.3.6 Client Monitor Data */
/* monitorCount (4 bytes): A 32-bit, unsigned integer. The number of display */
/* monitor definitions in the monitorDefArray field (the maximum allowed is 16). */
-#define CLIENT_MONITOR_DATA_MAXIMUM_MONITORS 16
+#define CLIENT_MONITOR_DATA_MAXIMUM_MONITORS 16
+
+/* 2.2.1.3.6 Client Monitor Data */
+/* The maximum width of the virtual desktop resulting from the union of the monitors */
+/* contained in the monitorDefArray field MUST NOT exceed 32,766 pixels. Similarly, */
+/* the maximum height of the virtual desktop resulting from the union of the monitors */
+/* contained in the monitorDefArray field MUST NOT exceed 32,766 pixels. */
+/* The minimum permitted size of the virtual desktop is 200 x 200 pixels. */
+#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_WIDTH 0xC8
+#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_HEIGHT 0xC8
+#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH 0x7FFE
+#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT 0x7FFE
+
+/* 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */
+#define TS_MONITOR_PRIMARY 0x00000001
/* Options field */
/* NOTE: XR_ prefixed to avoid conflict with FreeRDP */
diff --git a/common/ms-rdpedisp.h b/common/ms-rdpedisp.h
index dd3d51e7..2e45b945 100644
--- a/common/ms-rdpedisp.h
+++ b/common/ms-rdpedisp.h
@@ -23,7 +23,19 @@
#define MS_RDPEDISP_H
/* Display Control Messages: Display Virtual Channel Extension (2.2.2) */
-#define DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002
-#define DISPLAYCONTROL_PDU_TYPE_CAPS 0x00000005
+#define DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002
+#define DISPLAYCONTROL_PDU_TYPE_CAPS 0x00000005
+
+/* Display Control Monitor Layout (2.2.2.2.1) */
+#define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001
+#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_WIDTH 0xC8
+#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_HEIGHT 0xC8
+#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_WIDTH 0x2000
+#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_HEIGHT 0x2000
+
+#define ORIENTATION_LANDSCAPE 0
+#define ORIENTATION_PORTRAIT 90
+#define ORIENTATION_LANDSCAPE_FLIPPED 180
+#define ORIENTATION_PORTRAIT_FLIPPED 270
#endif /* MS_RDPEDISP_H */
diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h
index f45195e8..106e47a7 100644
--- a/common/xrdp_client_info.h
+++ b/common/xrdp_client_info.h
@@ -24,12 +24,28 @@
#if !defined(XRDP_CLIENT_INFO_H)
#define XRDP_CLIENT_INFO_H
+/*
+ * 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF)
+ * 2.2.1.3.9.1 Monitor Attributes (TS_MONITOR_ATTRIBUTES)
+ * 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT
+ */
struct monitor_info
{
+ /* From 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */
int left;
int top;
int right;
int bottom;
+ int flags;
+
+ /* From 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT */
+ int physical_width;
+ int physical_height;
+ int orientation;
+ int desktop_scale_factor;
+ int device_scale_factor;
+
+ /* Derived setting */
int is_primary;
};
@@ -41,6 +57,15 @@ struct xrdp_keyboard_overrides
int layout;
};
+struct display_size_description
+{
+ int monitorCount; /* number of monitors detected (max = 16) */
+ struct monitor_info minfo[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; /* client monitor data */
+ struct monitor_info minfo_wm[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; /* client monitor data, non-negative values */
+ int session_width;
+ int session_height;
+};
+
/**
* Information about the xrdp client
*