diff --git a/client/Windows/wf_event.c b/client/Windows/wf_event.c index b8065a3aa..00d8bf237 100644 --- a/client/Windows/wf_event.c +++ b/client/Windows/wf_event.c @@ -543,7 +543,7 @@ BOOL wf_scale_blt(wfInfo* wfi, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, if (!wh) wh = dh; - if (wfi->fullscreen || !wfi->instance->settings->SmartSizing || (ww >= dw && wh >= dh)) + if (wfi->fullscreen || !wfi->instance->settings->SmartSizing || (ww == dw && wh == dh)) { return BitBlt(hdc, x, y, w, h, wfi->primary->hdc, x1, y1, SRCCOPY); } @@ -552,7 +552,7 @@ BOOL wf_scale_blt(wfInfo* wfi, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, SetStretchBltMode(hdc, HALFTONE); SetBrushOrgEx(hdc, 0, 0, NULL); - return StretchBlt(hdc, MIN(x, x * ww / dw), MIN(y, y * wh / dh), MIN(dw, ww), MIN(dh, wh), wfi->primary->hdc, x1, y1, dw, dh, SRCCOPY); + return StretchBlt(hdc, 0, 0, ww, wh, wfi->primary->hdc, 0, 0, dw, dh, SRCCOPY); } return TRUE; @@ -573,8 +573,8 @@ void wf_scale_mouse_event(wfInfo* wfi, rdpInput* input, UINT16 flags, UINT16 x, dw = wfi->instance->settings->DesktopWidth; dh = wfi->instance->settings->DesktopHeight; - if (!wfi->instance->settings->SmartSizing || (ww >= dw) && (wh >= dh)) + if (!wfi->instance->settings->SmartSizing || (ww == dw) && (wh == dh)) input->MouseEvent(input, flags, x + wfi->xCurrentScroll, y + wfi->yCurrentScroll); else - input->MouseEvent(input, flags, MAX(x, x * dw / ww) + wfi->xCurrentScroll, MAX(y, y * dh / wh) + wfi->yCurrentScroll); + input->MouseEvent(input, flags, x * dw / ww + wfi->xCurrentScroll, y * dh / wh + wfi->yCurrentScroll); } diff --git a/client/Windows/wf_gdi.c b/client/Windows/wf_gdi.c index f0a028522..a6736e539 100644 --- a/client/Windows/wf_gdi.c +++ b/client/Windows/wf_gdi.c @@ -190,10 +190,10 @@ void wf_scale_rect(wfInfo* wfi, RECT* source) if (wfi->instance->settings->SmartSizing && (ww != dw || wh != dh)) { - source->bottom = MIN(source->bottom + 2, MAX(0, source->bottom * wh / dh + 2)); - source->top = MIN(source->top - 2, MAX(0, source->top * wh / dh - 2)); - source->left = MIN(source->left - 2, MAX(0, source->left * ww / dw - 2)); - source->right = MIN(source->right + 2, MAX(0, source->right * ww / dw + 2)); + source->bottom = source->bottom * wh / dh + 20; + source->top = source->top * wh / dh - 20; + source->left = source->left * ww / dw - 20; + source->right = source->right * ww / dw + 20; } source->bottom -= wfi->yCurrentScroll; diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index b68b31322..7e64be5e2 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -782,6 +782,7 @@ void gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_co freerdp_bitmap_write(tile_bitmap, gdi->tile->bitmap->data, 64, 64, 32); #endif + for (j = 0; j < message->num_rects; j++) { gdi_SetClipRgn(gdi->primary->hdc,