summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_bitmap.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-08-24 01:09:33 +0000
committerjsorg71 <jsorg71>2005-08-24 01:09:33 +0000
commit7d891a1bde2f8287f333fda9acc88310d783da73 (patch)
tree5202a565b2bee120ed075a0cac95221b3f1e0427 /xrdp/xrdp_bitmap.c
parent1881c8b1b847ef0de1c42f635ee9e10b99b5863e (diff)
downloadxrdp-proprietary-7d891a1bde2f8287f333fda9acc88310d783da73.tar.gz
xrdp-proprietary-7d891a1bde2f8287f333fda9acc88310d783da73.zip
added server_reset(which uses demand_active) for resizing the rdp client
Diffstat (limited to 'xrdp/xrdp_bitmap.c')
-rw-r--r--xrdp/xrdp_bitmap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c
index bc1a2c46..17d38f01 100644
--- a/xrdp/xrdp_bitmap.c
+++ b/xrdp/xrdp_bitmap.c
@@ -98,7 +98,7 @@ xrdp_bitmap_create(int width, int height, int bpp,
case 15: Bpp = 2; break;
case 16: Bpp = 2; break;
}
- if (self->type == WND_TYPE_SCREEN || self->type == WND_TYPE_BITMAP)
+ if (self->type == WND_TYPE_BITMAP || self->type == WND_TYPE_IMAGE)
{
self->data = (char*)g_malloc(width * height * Bpp, 0);
}
@@ -303,7 +303,10 @@ xrdp_bitmap_resize(struct xrdp_bitmap* self, int width, int height)
{
int Bpp;
- g_free(self->data);
+ if (width == self->width && height == self->height)
+ {
+ return 0;
+ }
self->width = width;
self->height = height;
Bpp = 4;
@@ -313,7 +316,11 @@ xrdp_bitmap_resize(struct xrdp_bitmap* self, int width, int height)
case 15: Bpp = 2; break;
case 16: Bpp = 2; break;
}
- self->data = (char*)g_malloc(width * height * Bpp, 1);
+ if (self->data != 0)
+ {
+ g_free(self->data);
+ self->data = (char*)g_malloc(width * height * Bpp, 1);
+ }
self->line_size = width * Bpp;
return 0;
}