File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
crates/ironrdp-server/src Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -284,10 +284,16 @@ pub trait RdpServerDisplayUpdates {
284284#[ async_trait:: async_trait]
285285pub 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
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments