-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify monitor processing logic. #1895
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,13 +24,29 @@ | |
#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 is_primary; | ||
int flags; | ||
|
||
/* From 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT */ | ||
unsigned int physical_width; | ||
unsigned int physical_height; | ||
unsigned int orientation; | ||
unsigned int desktop_scale_factor; | ||
unsigned int device_scale_factor; | ||
|
||
/* Derived setting */ | ||
unsigned int is_primary; | ||
}; | ||
|
||
/* xrdp keyboard overrids */ | ||
|
@@ -41,6 +57,15 @@ struct xrdp_keyboard_overrides | |
int layout; | ||
}; | ||
|
||
struct display_size_description | ||
{ | ||
unsigned int monitorCount; /* 2.2.2.2 DISPLAYCONTROL_MONITOR_LAYOUT_PDU: 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 */ | ||
unsigned int session_width; | ||
unsigned int session_height; | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's some duplication here - the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know. I didn't want to change xrdp_client_info since that will incur a revision of the header file and also affect xorgxrdp. I want to make the change to unify these two, but not in this PR... I want to do it for a PR that's focused on unifying these two data structures and leave the ones that change xorgxrdp more focused and linked. Make sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that's fine- you can raise a PR now and mark it as draft if you like to keep the book-keeping simple. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to actually just do it now. It's not as terrible as I thought. |
||
/** | ||
* Information about the xrdp client | ||
* | ||
|
@@ -54,8 +79,6 @@ struct xrdp_client_info | |
int size; /* bytes for this structure */ | ||
int version; /* Should be CLIENT_INFO_CURRENT_VERSION */ | ||
int bpp; | ||
int width; | ||
int height; | ||
/* bitmap cache info */ | ||
int cache1_entries; | ||
int cache1_size; | ||
|
@@ -128,9 +151,7 @@ struct xrdp_client_info | |
|
||
int security_layer; /* 0 = rdp, 1 = tls , 2 = hybrid */ | ||
int multimon; /* 0 = deny , 1 = allow */ | ||
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 */ | ||
struct display_size_description display_sizes; | ||
|
||
int keyboard_type; | ||
int keyboard_subtype; | ||
|
@@ -186,6 +207,6 @@ struct xrdp_client_info | |
}; | ||
|
||
/* yyyymmdd of last incompatible change to xrdp_client_info */ | ||
#define CLIENT_INFO_CURRENT_VERSION 20210723 | ||
#define CLIENT_INFO_CURRENT_VERSION 20220320 | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify what the difference between what these two fields represent?
it seems like
minfo
is the client side representation of the monitor layout, andminfo_wm
is the server side representation of the same monitor layout. Is that correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pardon me for jumping in, but since I'm here and I've used these values I can say that that's essentially correct The _wm values are normalised for a top-left co-ordinate of (0,0), which is useful for some bits of the software, namely the VNC multimon stuff and the login window.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. Does this need further documentation in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'm happy with the existing comment