diff --git a/crates/ironrdp-server/src/display.rs b/crates/ironrdp-server/src/display.rs index 2450b2017..7c48ad0bd 100644 --- a/crates/ironrdp-server/src/display.rs +++ b/crates/ironrdp-server/src/display.rs @@ -284,10 +284,16 @@ pub trait RdpServerDisplayUpdates { #[async_trait::async_trait] pub trait RdpServerDisplay: Send { /// This method should return the current size of the display. - /// Currently, there is no way for the client to negotiate resolution, - /// so the size returned by this method will be enforced. async fn size(&mut self) -> DesktopSize; + /// Request an initial size for the display. + /// + /// This method should return the negotiated display size. + async fn request_initial_size(&mut self, client_size: DesktopSize) -> DesktopSize { + debug!(?client_size, "Requesting initial size"); + self.size().await + } + /// Return a display updates receiver async fn updates(&mut self) -> Result>; diff --git a/crates/ironrdp-server/src/server.rs b/crates/ironrdp-server/src/server.rs index 854020595..5b35b54c3 100644 --- a/crates/ironrdp-server/src/server.rs +++ b/crates/ironrdp-server/src/server.rs @@ -736,7 +736,7 @@ impl RdpServer { width: b.desktop_width, height: b.desktop_height, }; - let display_size = self.display.lock().await.size().await; + let display_size = self.display.lock().await.request_initial_size(client_size).await; // It's problematic when the client didn't resize, as we send bitmap updates that don't fit. // The client will likely drop the connection.