Merge pull request #4464 from perkerk/misc-windows-client

Misc changes for Windows client
This commit is contained in:
akallabeth 2018-03-07 13:47:23 +01:00 committed by GitHub
commit ce61ec1d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 19 deletions

View File

@ -566,14 +566,6 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam,
PostQuitMessage(WM_QUIT);
break;
case WM_SETCURSOR:
if (LOWORD(lParam) == HTCLIENT)
SetCursor(wfc->hDefaultCursor);
else
DefWindowProc(hWnd, Msg, wParam, lParam);
break;
case WM_SETFOCUS:
DEBUG_KBD("getting focus %X", hWnd);

View File

@ -351,6 +351,12 @@ void wf_resize_window(wfContext* wfc)
else if (!wfc->context.settings->Decorations)
{
SetWindowLongPtr(wfc->hwnd, GWL_STYLE, WS_CHILD);
if (settings->EmbeddedWindow)
{
wf_update_canvas_diff(wfc);
}
else
{
/* Now resize to get full canvas size and room for caption and borders */
SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, settings->DesktopWidth,
settings->DesktopHeight, SWP_FRAMECHANGED);
@ -358,6 +364,7 @@ void wf_resize_window(wfContext* wfc)
SetWindowPos(wfc->hwnd, HWND_TOP, -1, -1, settings->DesktopWidth + wfc->diff.x,
settings->DesktopHeight + wfc->diff.y, SWP_NOMOVE | SWP_FRAMECHANGED);
}
}
else
{
SetWindowLongPtr(wfc->hwnd, GWL_STYLE,

View File

@ -130,6 +130,9 @@ static void wf_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
SelectObject(wf_bitmap->hdc, wf_bitmap->org_bitmap);
DeleteObject(wf_bitmap->bitmap);
DeleteDC(wf_bitmap->hdc);
_aligned_free(wf_bitmap->_bitmap.data);
wf_bitmap->_bitmap.data = NULL;
}
}

View File

@ -431,6 +431,12 @@ static int mf_compress(H264_CONTEXT* h264, const BYTE** ppSrcYuv, const UINT32*
return 1;
}
static BOOL mf_plat_loaded(H264_CONTEXT_MF* sys)
{
return sys->MFStartup && sys->MFShutdown && sys->MFCreateSample
&& sys->MFCreateMemoryBuffer && sys->MFCreateMediaType;
}
static void mf_uninit(H264_CONTEXT* h264)
{
UINT32 x;
@ -470,8 +476,14 @@ static void mf_uninit(H264_CONTEXT* h264)
if (sys->mfplat)
{
if (mf_plat_loaded(sys))
sys->MFShutdown();
FreeLibrary(sys->mfplat);
sys->mfplat = NULL;
if (mf_plat_loaded(sys))
CoUninitialize();
}
for (x = 0; x < sizeof(h264->pYUVData) / sizeof(h264->pYUVData[0]); x++)
@ -479,8 +491,7 @@ static void mf_uninit(H264_CONTEXT* h264)
memset(h264->pYUVData, 0, sizeof(h264->pYUVData));
memset(h264->iStride, 0, sizeof(h264->iStride));
sys->MFShutdown();
CoUninitialize();
free(sys);
h264->pSystemData = NULL;
}
@ -510,8 +521,7 @@ static BOOL mf_init(H264_CONTEXT* h264)
sys->MFCreateMediaType = (pfnMFCreateMediaType) GetProcAddress(sys->mfplat,
"MFCreateMediaType");
if (!sys->MFStartup || !sys->MFShutdown || !sys->MFCreateSample
|| !sys->MFCreateMemoryBuffer || !sys->MFCreateMediaType)
if (!mf_plat_loaded(sys))
goto error;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);

View File

@ -614,9 +614,14 @@ BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar,
}
else /* YCoCg */
{
UINT32 TempFormat;
BYTE* pTempData = planar->pTempData;
UINT32 nTempStep = planar->nTempStep;
UINT32 TempFormat = PIXEL_FORMAT_BGRA32;
if (alpha)
TempFormat = PIXEL_FORMAT_BGRA32;
else
TempFormat = PIXEL_FORMAT_BGRX32;
if (!pTempData)
return FALSE;