@@ -436,20 +436,7 @@ impl RdpServer {
436
436
DisplayUpdate :: PointerPosition ( pos) => encoder. pointer_position ( pos) ,
437
437
DisplayUpdate :: Resize ( desktop_size) => {
438
438
debug ! ( ?desktop_size, "Display resize" ) ;
439
- let pdu = ShareControlPdu :: ServerDeactivateAll ( ServerDeactivateAll ) ;
440
- let pdu = rdp:: headers:: ShareControlHeader {
441
- share_id : 0 ,
442
- pdu_source : io_channel_id,
443
- share_control_pdu : pdu,
444
- } ;
445
- let user_data = encode_vec ( & pdu) ?. into ( ) ;
446
- let pdu = SendDataIndication {
447
- initiator_id : user_channel_id,
448
- channel_id : io_channel_id,
449
- user_data,
450
- } ;
451
- let msg = encode_vec ( & X224 ( pdu) ) ?;
452
- writer. write_all ( & msg) . await ?;
439
+ deactivate_all ( io_channel_id, user_channel_id, writer) . await ?;
453
440
return Ok ( ( RunState :: DeactivationReactivation { desktop_size } , encoder) ) ;
454
441
}
455
442
DisplayUpdate :: RGBAPointer ( ptr) => encoder. rgba_pointer ( ptr) ,
@@ -940,6 +927,28 @@ impl RdpServer {
940
927
}
941
928
}
942
929
930
+ async fn deactivate_all (
931
+ io_channel_id : u16 ,
932
+ user_channel_id : u16 ,
933
+ writer : & mut impl FramedWrite ,
934
+ ) -> Result < ( ) , anyhow:: Error > {
935
+ let pdu = ShareControlPdu :: ServerDeactivateAll ( ServerDeactivateAll ) ;
936
+ let pdu = rdp:: headers:: ShareControlHeader {
937
+ share_id : 0 ,
938
+ pdu_source : io_channel_id,
939
+ share_control_pdu : pdu,
940
+ } ;
941
+ let user_data = encode_vec ( & pdu) ?. into ( ) ;
942
+ let pdu = SendDataIndication {
943
+ initiator_id : user_channel_id,
944
+ channel_id : io_channel_id,
945
+ user_data,
946
+ } ;
947
+ let msg = encode_vec ( & X224 ( pdu) ) ?;
948
+ writer. write_all ( & msg) . await ?;
949
+ Ok ( ( ) )
950
+ }
951
+
943
952
struct SharedWriter < ' w , W : FramedWrite > {
944
953
writer : Rc < Mutex < & ' w mut W > > ,
945
954
}
0 commit comments