From 49d51ef3ab1a1bbf77e1fec8f64b24fd26b23c64 Mon Sep 17 00:00:00 2001 From: Gyuhwan Park Date: Sun, 12 Jun 2022 05:12:44 +0900 Subject: fix: improve compatibility with mstsc.exe --- ulalaca.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ulalaca.cpp b/ulalaca.cpp index 618bf7e..f5f8777 100644 --- a/ulalaca.cpp +++ b/ulalaca.cpp @@ -251,15 +251,16 @@ int XrdpUlalaca::decideCopyRectSize() const { bool isRFXCodec = _clientInfo.rfx_codec_id != 0; bool isJPEGCodec = _clientInfo.jpeg_codec_id != 0; bool isH264Codec = _clientInfo.h264_codec_id != 0; + bool isGFXH264Codec = _clientInfo.capture_code & 3; - if (isRFXCodec || isJPEGCodec) { - return 64; - } - if (isH264Codec) { - // return 256; + if (isH264Codec || isGFXH264Codec) { return RECT_SIZE_BYPASS_CREATE; } + + if (isRFXCodec || isJPEGCodec) { + return 64; + } return RECT_SIZE_BYPASS_CREATE; } @@ -269,6 +270,7 @@ std::unique_ptr> XrdpUlalaca::createCopyRects( int rectSize ) const { auto blocks = std::make_unique>(); + blocks->reserve(128); if (rectSize == RECT_SIZE_BYPASS_CREATE) { std::copy(dirtyRects.begin(), dirtyRects.end(), std::back_insert_iterator(*blocks)); -- cgit v1.2.3 From f5cec2d0c65722d161805d81e042f0919c31c0c6 Mon Sep 17 00:00:00 2001 From: Gyuhwan Park Date: Sun, 12 Jun 2022 05:15:06 +0900 Subject: xxx: update entire screen when lib_mod_server_monitor_full_invalidate has called --- ulalaca.cpp | 6 +++++- ulalaca.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ulalaca.cpp b/ulalaca.cpp index f5f8777..cd3d7b9 100644 --- a/ulalaca.cpp +++ b/ulalaca.cpp @@ -48,6 +48,7 @@ XrdpUlalaca::XrdpUlalaca(): si(nullptr), + _fullInvalidate(true), _sessionSize { 0, 0, 640, 480 }, _bpp(0), @@ -196,6 +197,7 @@ int XrdpUlalaca::lib_mod_server_monitor_resize(XrdpUlalaca *_this, int width, in } int XrdpUlalaca::lib_mod_server_monitor_full_invalidate(XrdpUlalaca *_this, int width, int height) { + _this->_fullInvalidate = true; return 0; } @@ -328,7 +330,7 @@ void XrdpUlalaca::commitUpdate(const uint8_t *image, int32_t width, int32_t heig Rect screenRect = {0, 0, (short) width, (short) height}; auto copyRectSize = decideCopyRectSize(); - if (_frameId > 0) { + if (_frameId > 0 || !_fullInvalidate) { auto copyRects = createCopyRects(_dirtyRects, copyRectSize); server_paint_rects( @@ -352,6 +354,8 @@ void XrdpUlalaca::commitUpdate(const uint8_t *image, int32_t width, int32_t heig width, height, 0, (_frameId++ % INT32_MAX) ); + + _fullInvalidate = false; } _dirtyRects.clear(); diff --git a/ulalaca.hpp b/ulalaca.hpp index 6960952..248f7e6 100644 --- a/ulalaca.hpp +++ b/ulalaca.hpp @@ -229,6 +229,7 @@ private: std::unique_ptr _socket; std::unique_ptr _projectionThread; + std::atomic_bool _fullInvalidate; std::mutex _commitUpdateLock; std::vector _dirtyRects; -- cgit v1.2.3