mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 16:34:18 +09:00
[gdi] clean up gdi_send_suppress_output
This commit is contained in:
@@ -1451,25 +1451,29 @@ void gdi_free(freerdp* instance)
|
||||
|
||||
BOOL gdi_send_suppress_output(rdpGdi* gdi, BOOL suppress)
|
||||
{
|
||||
RECTANGLE_16 rect;
|
||||
rdpSettings* settings = NULL;
|
||||
rdpUpdate* update = NULL;
|
||||
|
||||
if (!gdi || !gdi->context->settings || !gdi->context->update)
|
||||
if (!gdi || !gdi->context)
|
||||
return FALSE;
|
||||
|
||||
if (gdi->suppressOutput == suppress)
|
||||
return TRUE;
|
||||
|
||||
gdi->suppressOutput = suppress;
|
||||
settings = gdi->context->settings;
|
||||
update = gdi->context->update;
|
||||
rect.left = 0;
|
||||
rect.top = 0;
|
||||
|
||||
rdpContext* context = gdi->context;
|
||||
rdpSettings* settings = context->settings;
|
||||
WINPR_ASSERT(settings);
|
||||
|
||||
rdpUpdate* update = context->update;
|
||||
WINPR_ASSERT(update);
|
||||
|
||||
const UINT32 w = freerdp_settings_get_uint32(settings, FreeRDP_DesktopWidth);
|
||||
const UINT32 h = freerdp_settings_get_uint32(settings, FreeRDP_DesktopHeight);
|
||||
rect.right = WINPR_ASSERTING_INT_CAST(UINT16, w);
|
||||
rect.bottom = WINPR_ASSERTING_INT_CAST(UINT16, h);
|
||||
return update->SuppressOutput(gdi->context, !suppress, &rect);
|
||||
|
||||
const RECTANGLE_16 rect = { .left = 0,
|
||||
.top = 0,
|
||||
.right = WINPR_ASSERTING_INT_CAST(UINT16, w),
|
||||
.bottom = WINPR_ASSERTING_INT_CAST(UINT16, h) };
|
||||
|
||||
WINPR_ASSERT(update->SuppressOutput);
|
||||
return update->SuppressOutput(context, !suppress, &rect);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user