Merge pull request #2054 from erbth/wfreerdp

(hopefully) proper window style setup in wfreerdp at startup
This commit is contained in:
Marc-André Moreau 2014-09-05 15:06:04 -04:00
commit 7f9d05183c
2 changed files with 15 additions and 7 deletions

View File

@ -255,7 +255,10 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
// Set maximum window size for resizing
minmax = (MINMAXINFO*) lParam;
wf_update_canvas_diff(wfc);
//always use the last determined canvas diff, because it could be
//that the window is minimized when this gets called
//wf_update_canvas_diff(wfc);
if (!wfc->fullscreen)
{
@ -281,11 +284,14 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
wfc->client_y = windowRect.top;
}
wf_size_scrollbars(wfc, LOWORD(lParam), HIWORD(lParam));
if (wfc->client_width && wfc->client_height)
{
wf_size_scrollbars(wfc, LOWORD(lParam), HIWORD(lParam));
// Workaround: when the window is maximized, the call to "ShowScrollBars" returns TRUE but has no effect.
if (wParam == SIZE_MAXIMIZED && !wfc->fullscreen)
SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOMOVE | SWP_FRAMECHANGED);
// Workaround: when the window is maximized, the call to "ShowScrollBars" returns TRUE but has no effect.
if (wParam == SIZE_MAXIMIZED && !wfc->fullscreen)
SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOMOVE | SWP_FRAMECHANGED);
}
break;

View File

@ -394,10 +394,12 @@ BOOL wf_post_connect(freerdp* instance)
if (settings->EmbeddedWindow)
settings->Decorations = FALSE;
if (!settings->Decorations)
if (wfc->fullscreen)
dwStyle = WS_POPUP;
else if (!settings->Decorations)
dwStyle = WS_CHILD | WS_BORDER;
else
dwStyle = 0;
dwStyle = WS_CAPTION | WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX | WS_MAXIMIZEBOX;
if (!wfc->hwnd)
{