Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/ironrdp-server/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<dyn RdpServerDisplayUpdates>>;

Expand Down
2 changes: 1 addition & 1 deletion crates/ironrdp-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down