diff -Npur xrdp-old//dmx/dmx.c xrdp-new/dmx/dmx.c
--- xrdp-old//dmx/dmx.c	2013-03-12 06:29:04.000000000 -0400
+++ xrdp-new/dmx/dmx.c	2013-03-12 06:26:20.000000000 -0400
@@ -634,11 +634,11 @@ lib_mod_connect(struct mod* mod)
   mod->server_fill_rect(mod, 0, 0, mod->width, mod->height);
   mod->server_end_update(mod);
   mod->server_msg(mod, "started connecting", 0);
-  /* only support 8, 16 and 24 bpp connections from rdp client */
-  if (mod->bpp != 8 && mod->bpp != 16 && mod->bpp != 24)
+  /* only support 8, 15, 16 and 24 bpp connections from rdp client */
+  if (mod->bpp != 8 && mod->bpp != 15 && mod->bpp != 16 && mod->bpp != 24)
   {
     mod->server_msg(mod,
-      "error - only supporting 8, 16 and 24 bpp rdp connections", 0);
+      "error - only supporting 8, 15, 16 and 24 bpp rdp connections", 0);
     LIB_DEBUG(mod, "out lib_mod_connect error");
     return 1;
   }
diff -Npur xrdp-old//libxrdp/libxrdpinc.h xrdp-new/libxrdp/libxrdpinc.h
--- xrdp-old//libxrdp/libxrdpinc.h	2013-03-12 06:29:46.000000000 -0400
+++ xrdp-new/libxrdp/libxrdpinc.h	2013-03-12 06:25:54.000000000 -0400
@@ -63,6 +63,7 @@ struct xrdp_client_info
   int rdp5_performanceflags;
   int brush_cache_code; /* 0 = no cache 1 = 8x8 standard cache
                            2 = arbitrary dimensions */
+  int max_bpp;
 };
 
 struct xrdp_brush
diff -Npur xrdp-old//libxrdp/xrdp_rdp.c xrdp-new/libxrdp/xrdp_rdp.c
--- xrdp-old//libxrdp/xrdp_rdp.c	2013-03-12 06:29:44.000000000 -0400
+++ xrdp-new/libxrdp/xrdp_rdp.c	2013-03-12 06:25:56.000000000 -0400
@@ -112,6 +112,10 @@ xrdp_rdp_read_config(struct xrdp_client_
         client_info->channel_code = 1;
       }
     }
+    else if (g_strcasecmp(item, "max_bpp") == 0)
+    {
+      client_info->max_bpp = g_atoi(value);
+    }
   }
   list_delete(items);
   list_delete(values);
@@ -354,16 +358,19 @@ xrdp_rdp_parse_client_mcs_data(struct xr
       self->client_info.bpp = 24;
       break;
   }
-  /* todo - for now, don't allow unsupported bpp connections
-     xrdp_rdp_send_demand_active will tell the client what bpp to use */
-  if (self->client_info.bpp == 24)
-  {
-    //self->client_info.bpp = 16;
-  }
+
+  /* TODO 15 bpp does not work as expected, set to 16 */
   if (self->client_info.bpp == 15)
-  {
     self->client_info.bpp = 16;
+
+  if (self->client_info.max_bpp > 0)
+  {
+    if (self->client_info.bpp > self->client_info.max_bpp)
+    {
+      self->client_info.bpp = self->client_info.max_bpp;
+    }
   }
+
   p->p = p->data;
   DEBUG(("client width %d, client height %d bpp %d",
          self->client_info.width, self->client_info.height,
diff -Npur xrdp-old//xrdp/xrdp.ini xrdp-new/xrdp/xrdp.ini
--- xrdp-old//xrdp/xrdp.ini	2013-03-12 06:32:55.000000000 -0400
+++ xrdp-new/xrdp/xrdp.ini	2013-03-12 06:28:17.000000000 -0400
@@ -5,6 +5,7 @@ bitmap_compression=yes
 port=3389
 crypt_level=high
 channel_code=1
+max_bpp=24
 
 [xsessions]
 path=/usr/share/xsessions
diff -Npur xrdp-old//xrdp/xrdp_mm.c xrdp-new/xrdp/xrdp_mm.c
--- xrdp-old//xrdp/xrdp_mm.c	2013-03-12 06:29:58.000000000 -0400
+++ xrdp-new/xrdp/xrdp_mm.c	2013-03-12 06:26:03.000000000 -0400
@@ -198,6 +198,7 @@ xrdp_mm_send_login(struct xrdp_mm* self)
   int rv;
   int index;
   int count;
+  int xserverbpp;
   char* username;
   char* password;
   char* exec;
@@ -209,6 +210,7 @@ xrdp_mm_send_login(struct xrdp_mm* self)
   password = 0;
   exec = "";
   self->code = 0;
+  xserverbpp = 0;
   count = self->login_names->count;
   for (index = 0; index < count; index++)
   {
@@ -247,6 +249,10 @@ xrdp_mm_send_login(struct xrdp_mm* self)
         self->code = 10;
       }
     }
+    else if (g_strcasecmp(name, "xserverbpp") ==0)
+    {
+      xserverbpp = g_atoi(value);
+    }
   }
   if ((username == 0) || (password == 0))
   {
@@ -269,7 +275,14 @@ xrdp_mm_send_login(struct xrdp_mm* self)
   out_uint8a(s, exec, index);
   out_uint16_be(s, self->wm->screen->width);
   out_uint16_be(s, self->wm->screen->height);
-  out_uint16_be(s, self->wm->screen->bpp);
+  if (xserverbpp > 0)
+  {
+    out_uint16_be(s, xserverbpp);
+  }
+  else
+  {
+    out_uint16_be(s, self->wm->screen->bpp);
+  }
   out_uint16_be(s, self->wm->session->client_info->keylayout);
   s_mark_end(s);
   s_pop_layer(s, channel_hdr);
diff -Npur xrdp-old//xup/xup.c xrdp-new/xup/xup.c
--- xrdp-old//xup/xup.c	2013-03-12 06:30:10.000000000 -0400
+++ xrdp-new/xup/xup.c	2013-03-12 06:25:20.000000000 -0400
@@ -139,11 +139,11 @@ lib_mod_connect(struct mod* mod)
   mod->server_fill_rect(mod, 0, 0, mod->width, mod->height);
   mod->server_end_update(mod);
   mod->server_msg(mod, "started connecting", 0);
-  /* only support 8 and 16 bpp connections from rdp client */
-  if (mod->bpp != 8 && mod->bpp != 16)
+  /* only support 8, 15, 16 and 24 bpp connections from rdp client */
+  if (mod->bpp != 8 && mod->bpp != 15 && mod->bpp != 16 && mod->bpp != 24)
   {
     mod->server_msg(mod,
-      "error - only supporting 8 and 16 bpp rdp connections", 0);
+      "error - only supporting 8, 15, 16 and 24 bpp rdp connections", 0);
     LIB_DEBUG(mod, "out lib_mod_connect error");
     return 1;
   }
