Skip to content

Commit c648c4a

Browse files
committed
feat(server): expose client display size to RdpServerDisplay
This allows the server implementation to handle the requested initial client display size.
1 parent b099279 commit c648c4a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/ironrdp-server/src/display.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,16 @@ pub trait RdpServerDisplayUpdates {
284284
#[async_trait::async_trait]
285285
pub trait RdpServerDisplay: Send {
286286
/// This method should return the current size of the display.
287-
/// Currently, there is no way for the client to negotiate resolution,
288-
/// so the size returned by this method will be enforced.
289287
async fn size(&mut self) -> DesktopSize;
290288

289+
/// Request an initial size for the display.
290+
///
291+
/// This method should return the negotiated display size.
292+
async fn request_initial_size(&mut self, client_size: DesktopSize) -> DesktopSize {
293+
debug!(?client_size, "Requesting initial size");
294+
self.size().await
295+
}
296+
291297
/// Return a display updates receiver
292298
async fn updates(&mut self) -> Result<Box<dyn RdpServerDisplayUpdates>>;
293299

crates/ironrdp-server/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ impl RdpServer {
736736
width: b.desktop_width,
737737
height: b.desktop_height,
738738
};
739-
let display_size = self.display.lock().await.size().await;
739+
let display_size = self.display.lock().await.request_initial_size(client_size).await;
740740

741741
// It's problematic when the client didn't resize, as we send bitmap updates that don't fit.
742742
// The client will likely drop the connection.

0 commit comments

Comments
 (0)