wfreerdp-server: fixed client screen resize

This commit is contained in:
C-o-r-E
2012-08-20 14:36:59 -04:00
parent 1438d28d97
commit e59f44b9e8
3 changed files with 37 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;
}