Skip to content

Commit 3259ed7

Browse files
committed
feat(connector): add a Config to enable gfx protocol
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
1 parent 659c599 commit 3259ed7

File tree

7 files changed

+16
-1
lines changed

7 files changed

+16
-1
lines changed

crates/ironrdp-client/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ impl Config {
322322
request_data: None,
323323
pointer_software_rendering: true,
324324
performance_flags: PerformanceFlags::default(),
325+
support_gfx: false,
325326
};
326327

327328
Ok(Self {

crates/ironrdp-connector/src/connection.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,12 @@ fn create_gcc_blocks<'a>(
662662
| ClientEarlyCapabilityFlags::SUPPORT_ERR_INFO_PDU
663663
| ClientEarlyCapabilityFlags::STRONG_ASYMMETRIC_KEYS
664664
| ClientEarlyCapabilityFlags::SUPPORT_SKIP_CHANNELJOIN;
665-
666665
// TODO(#136): support for ClientEarlyCapabilityFlags::SUPPORT_STATUS_INFO_PDU
667666

667+
if config.support_gfx {
668+
early_capability_flags |= ClientEarlyCapabilityFlags::SUPPORT_DYN_VC_GFX_PROTOCOL;
669+
}
670+
668671
if max_color_depth == 32 {
669672
early_capability_flags |= ClientEarlyCapabilityFlags::WANT_32_BPP_SESSION;
670673
}

crates/ironrdp-connector/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ pub struct Config {
176176
/// If true, the INFO_AUTOLOGON flag is set in the [`ClientInfoPdu`](ironrdp_pdu::rdp::ClientInfoPdu)
177177
pub autologon: bool,
178178
pub license_cache: Option<Arc<dyn LicenseCache>>,
179+
/// If true, the SUPPORT_DYN_VC_GFX_PROTOCOL flag is set
180+
pub support_gfx: bool,
179181

180182
// FIXME(@CBenoit): these are client-only options, not part of the connector.
181183
pub no_server_pointer: bool,

crates/ironrdp-testsuite-extra/tests/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,5 +300,6 @@ fn default_client_config() -> connector::Config {
300300
no_server_pointer: true,
301301
pointer_software_rendering: true,
302302
performance_flags: Default::default(),
303+
support_gfx: false,
303304
}
304305
}

crates/ironrdp-web/src/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ fn build_config(
863863
request_data: None,
864864
pointer_software_rendering: false,
865865
performance_flags: PerformanceFlags::default(),
866+
support_gfx: false,
866867
desktop_scale_factor: 0,
867868
hardware_id: None,
868869
license_cache: None,

crates/ironrdp/examples/screenshot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ fn build_config(username: String, password: String, domain: Option<String>) -> c
210210
autologon: false,
211211
pointer_software_rendering: true,
212212
performance_flags: PerformanceFlags::default(),
213+
support_gfx: false,
213214
desktop_scale_factor: 0,
214215
hardware_id: None,
215216
license_cache: None,

ffi/src/connector/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub mod ffi {
4141
pub autologon: Option<bool>,
4242
pub pointer_software_rendering: Option<bool>,
4343
pub performance_flags: Option<ironrdp::pdu::rdp::client_info::PerformanceFlags>,
44+
pub support_gfx: Option<bool>,
4445
}
4546

4647
#[diplomat::enum_convert(ironrdp::pdu::gcc::KeyboardType)]
@@ -147,6 +148,10 @@ pub mod ffi {
147148
self.autologon = Some(autologon);
148149
}
149150

151+
pub fn set_support_gfx(&mut self, support_gfx: bool) {
152+
self.support_gfx = Some(support_gfx);
153+
}
154+
150155
pub fn set_pointer_software_rendering(&mut self, pointer_software_rendering: bool) {
151156
self.pointer_software_rendering = Some(pointer_software_rendering);
152157
}
@@ -195,6 +200,7 @@ pub mod ffi {
195200
request_data: None,
196201
pointer_software_rendering: self.pointer_software_rendering.unwrap_or(false),
197202
performance_flags: self.performance_flags.ok_or("performance flag is missing")?,
203+
support_gfx: self.support_gfx.unwrap_or(false),
198204
desktop_scale_factor: 0,
199205
hardware_id: None,
200206
license_cache: None,

0 commit comments

Comments
 (0)