Merge pull request #396 from FreeRDP/issue366

Issue #366. Tested with XDMCP plugin.