From e59f44b9e8ddd2a67cf065a970c4177fb2dfae47 Mon Sep 17 00:00:00 2001 From: C-o-r-E Date: Mon, 20 Aug 2012 14:36:59 -0400 Subject: [PATCH] wfreerdp-server: fixed client screen resize --- server/Windows/wf_info.c | 22 ++++++++++++++++++++++ server/Windows/wf_info.h | 4 ++++ server/Windows/wf_peer.c | 11 +++++++++++ 3 files changed, 37 insertions(+) diff --git a/server/Windows/wf_info.c b/server/Windows/wf_info.c index c324143..762cba2 100644 --- a/server/Windows/wf_info.c +++ b/server/Windows/wf_info.c @@ -260,4 +260,26 @@ BOOL wf_info_have_invalid_region(wfInfo* info) if((info->invalid_x1 >= info->invalid_x2) || (info->invalid_y1 >= info->invalid_y2)) return false; return true; +} + +int wf_info_get_height(wfInfo* info) +{ + int ret; + + WaitForSingleObject(info->mutex, INFINITE); + ret = info->height; + ReleaseMutex(info->mutex); + + return ret; +} + +int wf_info_get_width(wfInfo* info) +{ + int ret; + + WaitForSingleObject(info->mutex, INFINITE); + ret = info->width; + ReleaseMutex(info->mutex); + + return ret; } \ No newline at end of file diff --git a/server/Windows/wf_info.h b/server/Windows/wf_info.h index 2291513..a0f590c 100644 --- a/server/Windows/wf_info.h +++ b/server/Windows/wf_info.h @@ -65,5 +65,9 @@ void wf_info_find_invalid_region(wfInfo* info); void wf_info_clear_invalid_region(wfInfo* info); BOOL wf_info_have_invalid_region(wfInfo* info); +int wf_info_get_height(wfInfo* info); +int wf_info_get_width(wfInfo* info); + + #endif \ No newline at end of file diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index 773c4f5..0cb6bab 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -220,6 +220,17 @@ boolean wf_peer_post_connect(freerdp_peer* client) printf("Client requested desktop: %dx%dx%d\n", client->settings->width, client->settings->height, client->settings->color_depth); + printf("But we will try resizing to %dx%dx%d\n", + wf_info_get_height(wfInfoSingleton), + wf_info_get_width(wfInfoSingleton), + 32 + ); + + client->settings->width = wf_info_get_width(wfInfoSingleton); + client->settings->height = wf_info_get_height(wfInfoSingleton); + + client->update->DesktopResize(client->update->context); + return true; } -- 2.7.4