Fixed context reset of sample server.
authorArmin Novak <armin.novak@thincast.com>
Tue, 1 Mar 2016 16:14:35 +0000 (17:14 +0100)
committerArmin Novak <armin.novak@thincast.com>
Wed, 2 Mar 2016 13:46:33 +0000 (14:46 +0100)
server/Sample/sfreerdp.c

index df33640..7e33947 100644 (file)
@@ -550,9 +550,12 @@ BOOL tf_peer_post_connect(freerdp_peer* client)
        WLog_DBG(TAG, "");
        WLog_DBG(TAG, "Client requested desktop: %dx%dx%d",
                         client->settings->DesktopWidth, client->settings->DesktopHeight, client->settings->ColorDepth);
+
 #if (SAMPLE_SERVER_USE_CLIENT_RESOLUTION == 1)
-       context->rfx_context->width = client->settings->DesktopWidth;
-       context->rfx_context->height = client->settings->DesktopHeight;
+       if (!rfx_context_reset(context->rfx_context, client->settings->DesktopWidth,
+                      client->settings->DesktopHeight))
+               return FALSE;
+
        WLog_DBG(TAG, "Using resolution requested by client.");
 #else
        client->settings->DesktopWidth = context->rfx_context->width;
@@ -660,8 +663,10 @@ BOOL tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
                        client->settings->DesktopWidth = SAMPLE_SERVER_DEFAULT_WIDTH;
                        client->settings->DesktopHeight = SAMPLE_SERVER_DEFAULT_HEIGHT;
                }
-               context->rfx_context->width = client->settings->DesktopWidth;
-               context->rfx_context->height = client->settings->DesktopHeight;
+               if (!rfx_context_reset(context->rfx_context, client->settings->DesktopWidth,
+                              client->settings->DesktopHeight))
+                       return FALSE;
+
                update->DesktopResize(update->context);
                context->activated = FALSE;
        }