fix moving a window shrinks it 14x7 when connect to server 2019

Signed-off-by: 2fly2 <wjatchd@163.com>
This commit is contained in:
2fly2 2022-05-07 09:21:21 +08:00 committed by akallabeth
parent ca9247ddd9
commit e1e2eef4e1
2 changed files with 26 additions and 9 deletions

View File

@ -138,10 +138,10 @@ void xf_rail_adjust_position(xfContext* xfc, xfAppWindow* appWindow)
* Calculate new size/position for the rail window(new values for
* windowOffsetX/windowOffsetY/windowWidth/windowHeight) on the server
*/
windowMove.left = appWindow->x;
windowMove.top = appWindow->y;
windowMove.right = windowMove.left + appWindow->width;
windowMove.bottom = windowMove.top + appWindow->height;
windowMove.left = appWindow->x - appWindow->resizeMarginLeft;
windowMove.top = appWindow->y - appWindow->resizeMarginTop;
windowMove.right = appWindow->x + appWindow->width + appWindow->resizeMarginRight;
windowMove.bottom = appWindow->y + appWindow->height + appWindow->resizeMarginBottom;
xfc->rail->ClientWindowMove(xfc->rail, &windowMove);
}
}
@ -171,12 +171,12 @@ void xf_rail_end_local_move(xfContext* xfc, xfAppWindow* appWindow)
* windowOffsetX/windowOffsetY/windowWidth/windowHeight) on the server
*
*/
windowMove.left = appWindow->x;
windowMove.top = appWindow->y;
windowMove.left = appWindow->x - appWindow->resizeMarginLeft;
windowMove.top = appWindow->y - appWindow->resizeMarginTop;
windowMove.right =
windowMove.left +
appWindow->width; /* In the update to RDP the position is one past the window */
windowMove.bottom = windowMove.top + appWindow->height;
appWindow->x +
appWindow->width + appWindow->resizeMarginRight; /* In the update to RDP the position is one past the window */
windowMove.bottom = appWindow->y + appWindow->height + appWindow->resizeMarginBottom;
xfc->rail->ClientWindowMove(xfc->rail, &windowMove);
/*
* Simulate button up at new position to end the local move (per RDP spec)
@ -352,6 +352,18 @@ static BOOL xf_rail_window_common(rdpContext* context, const WINDOW_ORDER_INFO*
appWindow->windowWidth = windowState->windowWidth;
appWindow->windowHeight = windowState->windowHeight;
}
if (fieldFlags & WINDOW_ORDER_FIELD_RESIZE_MARGIN_X)
{
appWindow->resizeMarginLeft = windowState->resizeMarginLeft;
appWindow->resizeMarginRight = windowState->resizeMarginRight;
}
if (fieldFlags & WINDOW_ORDER_FIELD_RESIZE_MARGIN_Y)
{
appWindow->resizeMarginTop = windowState->resizeMarginTop;
appWindow->resizeMarginBottom = windowState->resizeMarginBottom;
}
if (fieldFlags & WINDOW_ORDER_FIELD_OWNER)
{

View File

@ -135,6 +135,11 @@ struct xf_app_window
UINT32 localWindowOffsetCorrX;
UINT32 localWindowOffsetCorrY;
UINT32 resizeMarginLeft;
UINT32 resizeMarginTop;
UINT32 resizeMarginRight;
UINT32 resizeMarginBottom;
GC gc;
int shmid;