Implemented horizontal wheel support.
authorArmin Novak <armin.novak@thincast.com>
Mon, 14 Dec 2015 17:29:23 +0000 (18:29 +0100)
committerArmin Novak <armin.novak@thincast.com>
Mon, 14 Dec 2015 17:29:23 +0000 (18:29 +0100)
Horizontal mouse wheel input capabilities are now checked
and if available mouse buttons 6 and 7 are mapped to the
horizontal wheel for the X11 client.

client/X11/xf_event.c
include/freerdp/input.h
include/freerdp/settings.h
libfreerdp/core/capabilities.c
libfreerdp/core/capabilities.h
libfreerdp/core/settings.c

index 25023d5..e5d8058 100644 (file)
@@ -331,7 +331,7 @@ BOOL xf_generic_ButtonPress(xfContext* xfc, int x, int y, int button, Window win
 
                case 5:
                        wheel = TRUE;
-                       flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
+                       flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0078;
                        break;
 
                case 8:         /* back */
@@ -346,9 +346,18 @@ BOOL xf_generic_ButtonPress(xfContext* xfc, int x, int y, int button, Window win
                        flags = PTR_XFLAGS_DOWN | PTR_XFLAGS_BUTTON2;
                        break;
 
-               //TODO handle: case 6:          /* wheel left or back */
-               //TODO handle: case 7:          /* wheel right or forward */
-               
+               case 6:         /* wheel left */
+                       wheel = TRUE;
+                       if (xfc->settings->HasHorizontalWheel)
+                               flags = PTR_FLAGS_HWHEEL | 0x0078;
+                       break;
+
+               case 7:         /* wheel right */
+                       wheel = TRUE;
+                       if (xfc->settings->HasHorizontalWheel)
+                               flags = PTR_FLAGS_HWHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0078;
+                       break;
+
                default:
                        x = 0;
                        y = 0;
index 5704712..cbca343 100644 (file)
@@ -35,6 +35,7 @@ typedef struct rdp_input rdpInput;
 #define KBD_FLAGS_RELEASE              0x8000
 
 /* Pointer Flags */
+#define PTR_FLAGS_HWHEEL               0x0400
 #define PTR_FLAGS_WHEEL                        0x0200
 #define PTR_FLAGS_WHEEL_NEGATIVE       0x0100
 #define PTR_FLAGS_MOVE                 0x0800
index 388551a..5b3d431 100644 (file)
@@ -1232,7 +1232,8 @@ struct rdp_settings
        ALIGN64 BOOL MultiTouchInput; /* 2631 */
        ALIGN64 BOOL MultiTouchGestures; /* 2632 */
        ALIGN64 UINT32 KeyboardHook; /* 2633 */
-       UINT64 padding2688[2688 - 2634]; /* 2634 */
+       ALIGN64 BOOL HasHorizontalWheel; /* 2634 */
+       UINT64 padding2688[2688 - 2635]; /* 2635 */
 
        /* Brush Capabilities */
        ALIGN64 UINT32 BrushSupportLevel; /* 2688 */
index 0192b51..c1ac6d5 100644 (file)
@@ -1236,6 +1236,8 @@ BOOL rdp_read_input_capability_set(wStream* s, UINT16 length, rdpSettings* setti
                {
                        /* advertised by RDP 5.2, 6.0, 6.1 and 7.0 servers */
                }
+               else if (inputFlags & TS_INPUT_FLAG_MOUSE_HWHEEL)
+                       settings->HasHorizontalWheel = TRUE;
                else
                {
                        /* server does not support fastpath input */
@@ -1261,7 +1263,7 @@ void rdp_write_input_capability_set(wStream* s, rdpSettings* settings)
 
        header = rdp_capability_set_start(s);
 
-       inputFlags = INPUT_FLAG_SCANCODES | INPUT_FLAG_MOUSEX | INPUT_FLAG_UNICODE;
+       inputFlags = INPUT_FLAG_SCANCODES | INPUT_FLAG_MOUSEX | INPUT_FLAG_UNICODE | TS_INPUT_FLAG_MOUSE_HWHEEL;
 
        if (settings->FastPathInput)
        {
index 4a6191d..06ed108 100644 (file)
@@ -98,6 +98,8 @@
 #define INPUT_FLAG_FASTPATH_INPUT              0x0008
 #define INPUT_FLAG_UNICODE                     0x0010
 #define INPUT_FLAG_FASTPATH_INPUT2             0x0020
+#define TS_INPUT_FLAG_MOUSE_HWHEEL             0x0100
+#define TS_INPUT_FLAG_QOE_TIMESTAMPS           0x0200
 
 /* Font Support Flags */
 #define FONTSUPPORT_FONTLIST                   0x0001
index 2fb632f..df905ab 100644 (file)
@@ -230,306 +230,306 @@ rdpSettings* freerdp_settings_new(DWORD flags)
        if (!settings)
                return NULL;
 
-               settings->ServerMode = (flags & FREERDP_SETTINGS_SERVER_MODE) ? TRUE : FALSE;
-               settings->WaitForOutputBufferFlush = TRUE;
-
-               settings->DesktopWidth = 1024;
-               settings->DesktopHeight = 768;
-               settings->Workarea = FALSE;
-               settings->Fullscreen = FALSE;
-               settings->GrabKeyboard = TRUE;
-               settings->Decorations = TRUE;
-               settings->RdpVersion = 7;
-               settings->ColorDepth = 16;
-               settings->ExtSecurity = FALSE;
-               settings->NlaSecurity = TRUE;
-               settings->TlsSecurity = TRUE;
-               settings->RdpSecurity = TRUE;
-               settings->NegotiateSecurityLayer = TRUE;
-               settings->RestrictedAdminModeRequired = FALSE;
-               settings->MstscCookieMode = FALSE;
-               settings->CookieMaxLength = DEFAULT_COOKIE_MAX_LENGTH;
-               settings->ClientBuild = 2600;
-               settings->KeyboardType = 4;
-               settings->KeyboardSubType = 0;
-               settings->KeyboardFunctionKey = 12;
-               settings->KeyboardLayout = 0;
-               settings->UseRdpSecurityLayer = FALSE;
-               settings->SaltedChecksum = TRUE;
-               settings->ServerPort = 3389;
-               settings->GatewayPort = 443;
-               settings->DesktopResize = TRUE;
-               settings->ToggleFullscreen = TRUE;
-               settings->DesktopPosX = 0;
-               settings->DesktopPosY = 0;
-
-               settings->PerformanceFlags = PERF_FLAG_NONE;
-               settings->AllowFontSmoothing = FALSE;
-               settings->AllowDesktopComposition = FALSE;
-               settings->DisableWallpaper = FALSE;
-               settings->DisableFullWindowDrag = TRUE;
-               settings->DisableMenuAnims = TRUE;
-               settings->DisableThemes = FALSE;
-               settings->ConnectionType = CONNECTION_TYPE_LAN;
-
-               settings->EncryptionMethods = ENCRYPTION_METHOD_NONE;
-               settings->EncryptionLevel = ENCRYPTION_LEVEL_NONE;
-
-               settings->CompressionEnabled = TRUE;
-
-               if (settings->ServerMode)
-                               settings->CompressionLevel = PACKET_COMPR_TYPE_RDP61;
-               else
-                               settings->CompressionLevel = PACKET_COMPR_TYPE_RDP61;
-
-               settings->Authentication = TRUE;
-               settings->AuthenticationOnly = FALSE;
-               settings->CredentialsFromStdin = FALSE;
-               settings->DisableCredentialsDelegation = FALSE;
-               settings->AuthenticationLevel = 2;
-
-               settings->ChannelCount = 0;
-               settings->ChannelDefArraySize = 32;
-               settings->ChannelDefArray = (CHANNEL_DEF*) calloc(settings->ChannelDefArraySize, sizeof(CHANNEL_DEF));
-               if (!settings->ChannelDefArray)
-                               goto out_fail;
+       settings->ServerMode = (flags & FREERDP_SETTINGS_SERVER_MODE) ? TRUE : FALSE;
+       settings->WaitForOutputBufferFlush = TRUE;
+
+       settings->DesktopWidth = 1024;
+       settings->DesktopHeight = 768;
+       settings->Workarea = FALSE;
+       settings->Fullscreen = FALSE;
+       settings->GrabKeyboard = TRUE;
+       settings->Decorations = TRUE;
+       settings->RdpVersion = 7;
+       settings->ColorDepth = 16;
+       settings->ExtSecurity = FALSE;
+       settings->NlaSecurity = TRUE;
+       settings->TlsSecurity = TRUE;
+       settings->RdpSecurity = TRUE;
+       settings->NegotiateSecurityLayer = TRUE;
+       settings->RestrictedAdminModeRequired = FALSE;
+       settings->MstscCookieMode = FALSE;
+       settings->CookieMaxLength = DEFAULT_COOKIE_MAX_LENGTH;
+       settings->ClientBuild = 2600;
+       settings->KeyboardType = 4;
+       settings->KeyboardSubType = 0;
+       settings->KeyboardFunctionKey = 12;
+       settings->KeyboardLayout = 0;
+       settings->UseRdpSecurityLayer = FALSE;
+       settings->SaltedChecksum = TRUE;
+       settings->ServerPort = 3389;
+       settings->GatewayPort = 443;
+       settings->DesktopResize = TRUE;
+       settings->ToggleFullscreen = TRUE;
+       settings->DesktopPosX = 0;
+       settings->DesktopPosY = 0;
+
+       settings->PerformanceFlags = PERF_FLAG_NONE;
+       settings->AllowFontSmoothing = FALSE;
+       settings->AllowDesktopComposition = FALSE;
+       settings->DisableWallpaper = FALSE;
+       settings->DisableFullWindowDrag = TRUE;
+       settings->DisableMenuAnims = TRUE;
+       settings->DisableThemes = FALSE;
+       settings->ConnectionType = CONNECTION_TYPE_LAN;
+
+       settings->EncryptionMethods = ENCRYPTION_METHOD_NONE;
+       settings->EncryptionLevel = ENCRYPTION_LEVEL_NONE;
+
+       settings->CompressionEnabled = TRUE;
 
-               settings->MonitorCount = 0;
-               settings->MonitorDefArraySize = 32;
-               settings->MonitorDefArray = (rdpMonitor*) calloc(settings->MonitorDefArraySize, sizeof(rdpMonitor));
-               if (!settings->MonitorDefArray)
-                               goto out_fail;
+       if (settings->ServerMode)
+                       settings->CompressionLevel = PACKET_COMPR_TYPE_RDP61;
+       else
+                       settings->CompressionLevel = PACKET_COMPR_TYPE_RDP61;
+
+       settings->Authentication = TRUE;
+       settings->AuthenticationOnly = FALSE;
+       settings->CredentialsFromStdin = FALSE;
+       settings->DisableCredentialsDelegation = FALSE;
+       settings->AuthenticationLevel = 2;
+
+       settings->ChannelCount = 0;
+       settings->ChannelDefArraySize = 32;
+       settings->ChannelDefArray = (CHANNEL_DEF*) calloc(settings->ChannelDefArraySize, sizeof(CHANNEL_DEF));
+       if (!settings->ChannelDefArray)
+                       goto out_fail;
 
-               settings->MonitorLocalShiftX = 0;
-               settings->MonitorLocalShiftY = 0;
+       settings->MonitorCount = 0;
+       settings->MonitorDefArraySize = 32;
+       settings->MonitorDefArray = (rdpMonitor*) calloc(settings->MonitorDefArraySize, sizeof(rdpMonitor));
+       if (!settings->MonitorDefArray)
+                       goto out_fail;
 
-               settings->MonitorIds = (UINT32*) calloc(16, sizeof(UINT32));
-               if(!settings->MonitorIds)
-                               goto out_fail;
+       settings->MonitorLocalShiftX = 0;
+       settings->MonitorLocalShiftY = 0;
 
-               if (!settings_get_computer_name(settings))
+       settings->MonitorIds = (UINT32*) calloc(16, sizeof(UINT32));
+       if(!settings->MonitorIds)
                        goto out_fail;
 
-               settings->ReceivedCapabilities = calloc(1, 32);
-               if (!settings->ReceivedCapabilities)
-                               goto out_fail;
+       if (!settings_get_computer_name(settings))
+               goto out_fail;
 
-               settings->OrderSupport = calloc(1, 32);
-               if (!settings->OrderSupport)
-                               goto out_fail;
+       settings->ReceivedCapabilities = calloc(1, 32);
+       if (!settings->ReceivedCapabilities)
+                       goto out_fail;
 
-               settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_OPAQUE_RECT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_DRAWNINEGRID_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = TRUE;
-               settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
-               settings->OrderSupport[NEG_POLYLINE_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MEMBLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_MEM3BLT_INDEX] = TRUE;
-               settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = TRUE;
-               settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE;
-               settings->OrderSupport[NEG_FAST_INDEX_INDEX] = TRUE;
-               settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = TRUE;
-               settings->OrderSupport[NEG_POLYGON_SC_INDEX] = TRUE;
-               settings->OrderSupport[NEG_POLYGON_CB_INDEX] = TRUE;
-               settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = TRUE;
-               settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = TRUE;
-
-               settings->ClientProductId = calloc(1, 32);
-               if (!settings->ClientProductId)
-                               goto out_fail;
+       settings->OrderSupport = calloc(1, 32);
+       if (!settings->OrderSupport)
+                       goto out_fail;
 
-               settings->ClientHostname = calloc(1, 32);
-               if (!settings->ClientHostname)
-                               goto out_fail;
-               gethostname(settings->ClientHostname, 31);
-               settings->ClientHostname[31] = 0;
+       settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_OPAQUE_RECT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_DRAWNINEGRID_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = TRUE;
+       settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
+       settings->OrderSupport[NEG_POLYLINE_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MEMBLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_MEM3BLT_INDEX] = TRUE;
+       settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = TRUE;
+       settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE;
+       settings->OrderSupport[NEG_FAST_INDEX_INDEX] = TRUE;
+       settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = TRUE;
+       settings->OrderSupport[NEG_POLYGON_SC_INDEX] = TRUE;
+       settings->OrderSupport[NEG_POLYGON_CB_INDEX] = TRUE;
+       settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = TRUE;
+       settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = TRUE;
+
+       settings->ClientProductId = calloc(1, 32);
+       if (!settings->ClientProductId)
+                       goto out_fail;
 
-               settings->ColorPointerFlag = TRUE;
-               settings->LargePointerFlag = TRUE;
-               settings->PointerCacheSize = 20;
-               settings->SoundBeepsEnabled = TRUE;
+       settings->ClientHostname = calloc(1, 32);
+       if (!settings->ClientHostname)
+                       goto out_fail;
+       gethostname(settings->ClientHostname, 31);
+       settings->ClientHostname[31] = 0;
 
-               settings->DrawGdiPlusEnabled = FALSE;
+       settings->ColorPointerFlag = TRUE;
+       settings->LargePointerFlag = TRUE;
+       settings->PointerCacheSize = 20;
+       settings->SoundBeepsEnabled = TRUE;
 
-               settings->DrawAllowSkipAlpha = TRUE;
-               settings->DrawAllowColorSubsampling = FALSE;
-               settings->DrawAllowDynamicColorFidelity = FALSE;
+       settings->DrawGdiPlusEnabled = FALSE;
 
-               settings->FrameMarkerCommandEnabled = TRUE;
-               settings->SurfaceFrameMarkerEnabled = TRUE;
-               settings->BitmapCacheV3Enabled = FALSE;
+       settings->DrawAllowSkipAlpha = TRUE;
+       settings->DrawAllowColorSubsampling = FALSE;
+       settings->DrawAllowDynamicColorFidelity = FALSE;
 
-               settings->BitmapCacheEnabled = TRUE;
-               settings->BitmapCachePersistEnabled = FALSE;
-               settings->AllowCacheWaitingList = TRUE;
+       settings->FrameMarkerCommandEnabled = TRUE;
+       settings->SurfaceFrameMarkerEnabled = TRUE;
+       settings->BitmapCacheV3Enabled = FALSE;
 
-               settings->BitmapCacheV2NumCells = 5;
-               settings->BitmapCacheV2CellInfo = (BITMAP_CACHE_V2_CELL_INFO*) malloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6);
-               if (!settings->BitmapCacheV2CellInfo)
-                               goto out_fail;
-               settings->BitmapCacheV2CellInfo[0].numEntries = 600;
-               settings->BitmapCacheV2CellInfo[0].persistent = FALSE;
-               settings->BitmapCacheV2CellInfo[1].numEntries = 600;
-               settings->BitmapCacheV2CellInfo[1].persistent = FALSE;
-               settings->BitmapCacheV2CellInfo[2].numEntries = 2048;
-               settings->BitmapCacheV2CellInfo[2].persistent = FALSE;
-               settings->BitmapCacheV2CellInfo[3].numEntries = 4096;
-               settings->BitmapCacheV2CellInfo[3].persistent = FALSE;
-               settings->BitmapCacheV2CellInfo[4].numEntries = 2048;
-               settings->BitmapCacheV2CellInfo[4].persistent = FALSE;
-
-               settings->NoBitmapCompressionHeader = TRUE;
-
-               settings->RefreshRect = TRUE;
-               settings->SuppressOutput = TRUE;
-
-               settings->GlyphSupportLevel = GLYPH_SUPPORT_FULL;
-               settings->GlyphCache = malloc(sizeof(GLYPH_CACHE_DEFINITION) * 10);
-               if(!settings->GlyphCache)
-                               goto out_fail;
-               settings->FragCache = malloc(sizeof(GLYPH_CACHE_DEFINITION));
-               if(!settings->FragCache)
-                               goto out_fail;
-               settings->GlyphCache[0].cacheEntries = 254;
-               settings->GlyphCache[0].cacheMaximumCellSize = 4;
-               settings->GlyphCache[1].cacheEntries = 254;
-               settings->GlyphCache[1].cacheMaximumCellSize = 4;
-               settings->GlyphCache[2].cacheEntries = 254;
-               settings->GlyphCache[2].cacheMaximumCellSize = 8;
-               settings->GlyphCache[3].cacheEntries = 254;
-               settings->GlyphCache[3].cacheMaximumCellSize = 8;
-               settings->GlyphCache[4].cacheEntries = 254;
-               settings->GlyphCache[4].cacheMaximumCellSize = 16;
-               settings->GlyphCache[5].cacheEntries = 254;
-               settings->GlyphCache[5].cacheMaximumCellSize = 32;
-               settings->GlyphCache[6].cacheEntries = 254;
-               settings->GlyphCache[6].cacheMaximumCellSize = 64;
-               settings->GlyphCache[7].cacheEntries = 254;
-               settings->GlyphCache[7].cacheMaximumCellSize = 128;
-               settings->GlyphCache[8].cacheEntries = 254;
-               settings->GlyphCache[8].cacheMaximumCellSize = 256;
-               settings->GlyphCache[9].cacheEntries = 64;
-               settings->GlyphCache[9].cacheMaximumCellSize = 256;
-               settings->FragCache->cacheEntries = 256;
-               settings->FragCache->cacheMaximumCellSize = 256;
-
-               settings->OffscreenSupportLevel = TRUE;
-               settings->OffscreenCacheSize = 7680;
-               settings->OffscreenCacheEntries = 2000;
-
-               settings->DrawNineGridCacheSize = 2560;
-               settings->DrawNineGridCacheEntries = 256;
-
-               settings->ClientDir = _strdup(client_dll);
-               if (!settings->ClientDir)
-                               goto out_fail;
+       settings->BitmapCacheEnabled = TRUE;
+       settings->BitmapCachePersistEnabled = FALSE;
+       settings->AllowCacheWaitingList = TRUE;
 
-               settings->RemoteAppNumIconCaches = 3;
-               settings->RemoteAppNumIconCacheEntries = 12;
+       settings->BitmapCacheV2NumCells = 5;
+       settings->BitmapCacheV2CellInfo = (BITMAP_CACHE_V2_CELL_INFO*) malloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6);
+       if (!settings->BitmapCacheV2CellInfo)
+                       goto out_fail;
+       settings->BitmapCacheV2CellInfo[0].numEntries = 600;
+       settings->BitmapCacheV2CellInfo[0].persistent = FALSE;
+       settings->BitmapCacheV2CellInfo[1].numEntries = 600;
+       settings->BitmapCacheV2CellInfo[1].persistent = FALSE;
+       settings->BitmapCacheV2CellInfo[2].numEntries = 2048;
+       settings->BitmapCacheV2CellInfo[2].persistent = FALSE;
+       settings->BitmapCacheV2CellInfo[3].numEntries = 4096;
+       settings->BitmapCacheV2CellInfo[3].persistent = FALSE;
+       settings->BitmapCacheV2CellInfo[4].numEntries = 2048;
+       settings->BitmapCacheV2CellInfo[4].persistent = FALSE;
+
+       settings->NoBitmapCompressionHeader = TRUE;
+
+       settings->RefreshRect = TRUE;
+       settings->SuppressOutput = TRUE;
+
+       settings->GlyphSupportLevel = GLYPH_SUPPORT_FULL;
+       settings->GlyphCache = malloc(sizeof(GLYPH_CACHE_DEFINITION) * 10);
+       if(!settings->GlyphCache)
+                       goto out_fail;
+       settings->FragCache = malloc(sizeof(GLYPH_CACHE_DEFINITION));
+       if(!settings->FragCache)
+                       goto out_fail;
+       settings->GlyphCache[0].cacheEntries = 254;
+       settings->GlyphCache[0].cacheMaximumCellSize = 4;
+       settings->GlyphCache[1].cacheEntries = 254;
+       settings->GlyphCache[1].cacheMaximumCellSize = 4;
+       settings->GlyphCache[2].cacheEntries = 254;
+       settings->GlyphCache[2].cacheMaximumCellSize = 8;
+       settings->GlyphCache[3].cacheEntries = 254;
+       settings->GlyphCache[3].cacheMaximumCellSize = 8;
+       settings->GlyphCache[4].cacheEntries = 254;
+       settings->GlyphCache[4].cacheMaximumCellSize = 16;
+       settings->GlyphCache[5].cacheEntries = 254;
+       settings->GlyphCache[5].cacheMaximumCellSize = 32;
+       settings->GlyphCache[6].cacheEntries = 254;
+       settings->GlyphCache[6].cacheMaximumCellSize = 64;
+       settings->GlyphCache[7].cacheEntries = 254;
+       settings->GlyphCache[7].cacheMaximumCellSize = 128;
+       settings->GlyphCache[8].cacheEntries = 254;
+       settings->GlyphCache[8].cacheMaximumCellSize = 256;
+       settings->GlyphCache[9].cacheEntries = 64;
+       settings->GlyphCache[9].cacheMaximumCellSize = 256;
+       settings->FragCache->cacheEntries = 256;
+       settings->FragCache->cacheMaximumCellSize = 256;
+
+       settings->OffscreenSupportLevel = TRUE;
+       settings->OffscreenCacheSize = 7680;
+       settings->OffscreenCacheEntries = 2000;
+
+       settings->DrawNineGridCacheSize = 2560;
+       settings->DrawNineGridCacheEntries = 256;
+
+       settings->ClientDir = _strdup(client_dll);
+       if (!settings->ClientDir)
+                       goto out_fail;
 
-               settings->VirtualChannelChunkSize = CHANNEL_CHUNK_LENGTH;
+       settings->RemoteAppNumIconCaches = 3;
+       settings->RemoteAppNumIconCacheEntries = 12;
 
-               settings->MultifragMaxRequestSize = 0xFFFF;
+       settings->VirtualChannelChunkSize = CHANNEL_CHUNK_LENGTH;
 
-               settings->GatewayUseSameCredentials = FALSE;
-               settings->GatewayBypassLocal = FALSE;
-               settings->GatewayRpcTransport = TRUE;
-               settings->GatewayHttpTransport = TRUE;
-               settings->GatewayUdpTransport = TRUE;
+       settings->MultifragMaxRequestSize = 0xFFFF;
 
-               settings->FastPathInput = TRUE;
-               settings->FastPathOutput = TRUE;
+       settings->GatewayUseSameCredentials = FALSE;
+       settings->GatewayBypassLocal = FALSE;
+       settings->GatewayRpcTransport = TRUE;
+       settings->GatewayHttpTransport = TRUE;
+       settings->GatewayUdpTransport = TRUE;
 
-               settings->FrameAcknowledge = 2;
-               settings->MouseMotion = TRUE;
+       settings->FastPathInput = TRUE;
+       settings->FastPathOutput = TRUE;
 
-               settings->NSCodecColorLossLevel = 3;
-               settings->NSCodecAllowSubsampling = TRUE;
-               settings->NSCodecAllowDynamicColorFidelity = TRUE;
+       settings->FrameAcknowledge = 2;
+       settings->MouseMotion = TRUE;
 
-               settings->AutoReconnectionEnabled = FALSE;
-               settings->AutoReconnectMaxRetries = 20;
+       settings->NSCodecColorLossLevel = 3;
+       settings->NSCodecAllowSubsampling = TRUE;
+       settings->NSCodecAllowDynamicColorFidelity = TRUE;
 
-               settings->GfxThinClient = TRUE;
-               settings->GfxSmallCache = FALSE;
-               settings->GfxProgressive = FALSE;
-               settings->GfxProgressiveV2 = FALSE;
-               settings->GfxH264 = FALSE;
+       settings->AutoReconnectionEnabled = FALSE;
+       settings->AutoReconnectMaxRetries = 20;
 
-               settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) calloc(1, sizeof(ARC_CS_PRIVATE_PACKET));
-               if (!settings->ClientAutoReconnectCookie)
-                               goto out_fail;
-               settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) calloc(1, sizeof(ARC_SC_PRIVATE_PACKET));
-               if (!settings->ServerAutoReconnectCookie)
-                               goto out_fail;
+       settings->GfxThinClient = TRUE;
+       settings->GfxSmallCache = FALSE;
+       settings->GfxProgressive = FALSE;
+       settings->GfxProgressiveV2 = FALSE;
+       settings->GfxH264 = FALSE;
 
-               settings->ClientTimeZone = (TIME_ZONE_INFO*) calloc(1,sizeof(TIME_ZONE_INFO));
-               if (!settings->ClientTimeZone)
-                               goto out_fail;
+       settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) calloc(1, sizeof(ARC_CS_PRIVATE_PACKET));
+       if (!settings->ClientAutoReconnectCookie)
+                       goto out_fail;
+       settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) calloc(1, sizeof(ARC_SC_PRIVATE_PACKET));
+       if (!settings->ServerAutoReconnectCookie)
+                       goto out_fail;
 
-               settings->DeviceArraySize = 16;
-               settings->DeviceArray = (RDPDR_DEVICE**) calloc(1, sizeof(RDPDR_DEVICE*) * settings->DeviceArraySize);
-               if (!settings->DeviceArray)
-                               goto out_fail;
+       settings->ClientTimeZone = (TIME_ZONE_INFO*) calloc(1,sizeof(TIME_ZONE_INFO));
+       if (!settings->ClientTimeZone)
+                       goto out_fail;
 
-               settings->StaticChannelArraySize = 16;
-               settings->StaticChannelArray = (ADDIN_ARGV**)
-                                               calloc(1, sizeof(ADDIN_ARGV*) * settings->StaticChannelArraySize);
-               if (!settings->StaticChannelArray)
-                               goto out_fail;
+       settings->DeviceArraySize = 16;
+       settings->DeviceArray = (RDPDR_DEVICE**) calloc(1, sizeof(RDPDR_DEVICE*) * settings->DeviceArraySize);
+       if (!settings->DeviceArray)
+                       goto out_fail;
 
-               settings->DynamicChannelArraySize = 16;
-               settings->DynamicChannelArray = (ADDIN_ARGV**)
-                                               calloc(1, sizeof(ADDIN_ARGV*) * settings->DynamicChannelArraySize);
-               if(!settings->DynamicChannelArray)
-                               goto out_fail;
+       settings->StaticChannelArraySize = 16;
+       settings->StaticChannelArray = (ADDIN_ARGV**)
+                                       calloc(1, sizeof(ADDIN_ARGV*) * settings->StaticChannelArraySize);
+       if (!settings->StaticChannelArray)
+                       goto out_fail;
 
-               settings->HomePath = GetKnownPath(KNOWN_PATH_HOME);
-               if (!settings->HomePath)
-                               goto out_fail;
+       settings->DynamicChannelArraySize = 16;
+       settings->DynamicChannelArray = (ADDIN_ARGV**)
+                                       calloc(1, sizeof(ADDIN_ARGV*) * settings->DynamicChannelArraySize);
+       if(!settings->DynamicChannelArray)
+                       goto out_fail;
+
+       settings->HomePath = GetKnownPath(KNOWN_PATH_HOME);
+       if (!settings->HomePath)
+                       goto out_fail;
 
-               /* For default FreeRDP continue using same config directory
-                * as in old releases.
-                * Custom builds use <Vendor>/<Product> as config folder. */
-               if (_stricmp(FREERDP_VENDOR_STRING, FREERDP_PRODUCT_STRING))
+       /* For default FreeRDP continue using same config directory
+        * as in old releases.
+        * Custom builds use <Vendor>/<Product> as config folder. */
+       if (_stricmp(FREERDP_VENDOR_STRING, FREERDP_PRODUCT_STRING))
+       {
+               base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME,
+                                      FREERDP_VENDOR_STRING);
+               if (base)
                {
-                       base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME,
-                                              FREERDP_VENDOR_STRING);
-                       if (base)
-                       {
-                               settings->ConfigPath = GetCombinedPath(
-                                                              base,
-                                                              FREERDP_PRODUCT_STRING);
-                       }
-                       free (base);
-               } else {
-                       int i;
-                       char product[sizeof(FREERDP_PRODUCT_STRING)];
-
-                       memset(product, 0, sizeof(product));
-                       for (i=0; i<sizeof(product); i++)
-                               product[i] = tolower(FREERDP_PRODUCT_STRING[i]);
-
-                       settings->ConfigPath = GetKnownSubPath(
-                                                      KNOWN_PATH_XDG_CONFIG_HOME,
-                                                      product);
+                       settings->ConfigPath = GetCombinedPath(
+                                                      base,
+                                                      FREERDP_PRODUCT_STRING);
                }
+               free (base);
+       } else {
+               int i;
+               char product[sizeof(FREERDP_PRODUCT_STRING)];
+
+               memset(product, 0, sizeof(product));
+               for (i=0; i<sizeof(product); i++)
+                       product[i] = tolower(FREERDP_PRODUCT_STRING[i]);
+
+               settings->ConfigPath = GetKnownSubPath(
+                                              KNOWN_PATH_XDG_CONFIG_HOME,
+                                              product);
+       }
 
-               if (!settings->ConfigPath)
-                               goto out_fail;
+       if (!settings->ConfigPath)
+                       goto out_fail;
 
-               settings_load_hkey_local_machine(settings);
+       settings_load_hkey_local_machine(settings);
 
-               settings->SettingsModified = (BYTE*) calloc(1, sizeof(rdpSettings) / 8 );
-               if(!settings->SettingsModified)
-                               goto out_fail;
+       settings->SettingsModified = (BYTE*) calloc(1, sizeof(rdpSettings) / 8 );
+       if(!settings->SettingsModified)
+                       goto out_fail;
 
        return settings;