summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-05-22 08:27:09 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-05-22 08:27:09 -0700
commit900a2541ca94b5c4cb839c3bd6d35e6460ca1c48 (patch)
tree97dc231f119bfdc6a144a353d941bb44839e6579
parente09f14e6d47f1b67a42f8765b87f4eb405616319 (diff)
downloadxrdp-proprietary-900a2541ca94b5c4cb839c3bd6d35e6460ca1c48.tar.gz
xrdp-proprietary-900a2541ca94b5c4cb839c3bd6d35e6460ca1c48.zip
offscreen bitmaps: implement the delete list
-rw-r--r--libxrdp/libxrdp.c8
-rw-r--r--libxrdp/libxrdp.h4
-rw-r--r--libxrdp/libxrdpinc.h4
-rw-r--r--libxrdp/xrdp_orders.c9
-rw-r--r--xrdp/xrdp.h2
-rw-r--r--xrdp/xrdp_cache.c11
-rw-r--r--xrdp/xrdp_painter.c9
-rw-r--r--xrdp/xrdp_types.h1
8 files changed, 35 insertions, 13 deletions
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index 94eefaa9..5c228305 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -758,12 +758,12 @@ libxrdp_orders_send_brush(struct xrdp_session* session,
/*****************************************************************************/
int EXPORT_CC
libxrdp_orders_send_create_os_surface(struct xrdp_session* session, int id,
- int width, int height, int num_del_list,
- int* del_list)
+ int width, int height,
+ struct list* del_list)
{
return xrdp_orders_send_create_os_surface
- ((struct xrdp_orders*)(session->orders), id, width, height,
- num_del_list, del_list);
+ ((struct xrdp_orders*)(session->orders), id,
+ width, height, del_list);
}
/*****************************************************************************/
diff --git a/libxrdp/libxrdp.h b/libxrdp/libxrdp.h
index cb0637f7..7aae38b5 100644
--- a/libxrdp/libxrdp.h
+++ b/libxrdp/libxrdp.h
@@ -389,8 +389,8 @@ xrdp_orders_send_brush(struct xrdp_orders* self, int width, int height,
int bpp, int type, int size, char* data, int cache_id);
int APP_CC
xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id,
- int width, int height, int num_del_list,
- int* del_list);
+ int width, int height,
+ struct list* del_list);
int APP_CC
xrdp_orders_send_switch_os_surface(struct xrdp_orders* self, int id);
diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h
index 5bd9fffd..0dbfacc2 100644
--- a/libxrdp/libxrdpinc.h
+++ b/libxrdp/libxrdpinc.h
@@ -178,8 +178,8 @@ libxrdp_orders_send_brush(struct xrdp_session* session,
int size, char* data, int cache_id);
int EXPORT_CC
libxrdp_orders_send_create_os_surface(struct xrdp_session* session, int id,
- int width, int height, int num_del_list,
- int* del_list);
+ int width, int height,
+ struct list* del_list);
int EXPORT_CC
libxrdp_orders_send_switch_os_surface(struct xrdp_session* session, int id);
diff --git a/libxrdp/xrdp_orders.c b/libxrdp/xrdp_orders.c
index 5efba951..a52c5f92 100644
--- a/libxrdp/xrdp_orders.c
+++ b/libxrdp/xrdp_orders.c
@@ -1975,16 +1975,19 @@ xrdp_orders_send_brush(struct xrdp_orders* self, int width, int height,
/* send an off screen bitmap entry */
int APP_CC
xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id,
- int width, int height, int num_del_list,
- int* del_list)
+ int width, int height,
+ struct list* del_list)
{
int order_flags;
int cache_id;
int flags;
int index;
int bytes;
+ int num_del_list;
bytes = 7;
+ num_del_list = del_list->count;
+ g_writeln("xrdp_orders_send_create_os_surface: num_del_list %d", num_del_list);
if (num_del_list > 0)
{
bytes += 2;
@@ -2010,7 +2013,7 @@ xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id,
out_uint16_le(self->out_s, num_del_list);
for (index = 0; index < num_del_list; index++)
{
- cache_id = del_list[index] & 0x7fff;
+ cache_id = list_get_item(del_list, index) & 0x7fff;
out_uint16_le(self->out_s, cache_id);
}
}
diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h
index bc22a935..9b280bfc 100644
--- a/xrdp/xrdp.h
+++ b/xrdp/xrdp.h
@@ -27,6 +27,7 @@
#include "arch.h"
#include "parse.h"
#include "trans.h"
+#include "list.h"
#include "libxrdpinc.h"
#include "xrdp_types.h"
#include "xrdp_constants.h"
@@ -34,7 +35,6 @@
#include "os_calls.h"
#include "ssl_calls.h"
#include "thread_calls.h"
-#include "list.h"
#include "file.h"
#include "file_loc.h"
#include "xrdp_client_info.h"
diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c
index 32b32f72..9c708313 100644
--- a/xrdp/xrdp_cache.c
+++ b/xrdp/xrdp_cache.c
@@ -43,6 +43,7 @@ xrdp_cache_create(struct xrdp_wm* owner,
self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable;
self->bitmap_cache_version = client_info->bitmap_cache_version;
self->pointer_cache_entries = client_info->pointer_cache_entries;
+ self->xrdp_os_del_list = list_create();
return self;
}
@@ -78,6 +79,7 @@ xrdp_cache_delete(struct xrdp_cache* self)
{
xrdp_bitmap_delete(self->os_bitmap_items[i].bitmap);
}
+ list_delete(self->xrdp_os_del_list);
g_free(self);
}
@@ -564,12 +566,21 @@ int APP_CC
xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex)
{
struct xrdp_os_bitmap_item* bi;
+ int index;
if ((rdpindex < 0) || (rdpindex >= 2000))
{
return 1;
}
bi = self->os_bitmap_items + rdpindex;
+ if (bi->bitmap->tab_stop)
+ {
+ index = list_index_of(self->xrdp_os_del_list, rdpindex);
+ if (index == -1)
+ {
+ list_add_item(self->xrdp_os_del_list, rdpindex);
+ }
+ }
xrdp_bitmap_delete(bi->bitmap);
g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item));
return 0;
diff --git a/xrdp/xrdp_painter.c b/xrdp/xrdp_painter.c
index ada8a65b..b7caee31 100644
--- a/xrdp/xrdp_painter.c
+++ b/xrdp/xrdp_painter.c
@@ -52,6 +52,8 @@ int APP_CC
wm_painter_set_target(struct xrdp_painter* self)
{
int surface_index;
+ int index;
+ struct list* del_list;
if (self->wm->target_surface->type == WND_TYPE_SCREEN)
{
@@ -68,10 +70,15 @@ wm_painter_set_target(struct xrdp_painter* self)
{
if (self->wm->target_surface->tab_stop == 0) /* tab_stop is hack */
{
+ del_list = self->wm->cache->xrdp_os_del_list;
+ index = list_index_of(del_list, surface_index);
+ list_remove_item(del_list, index);
libxrdp_orders_send_create_os_surface(self->session, surface_index,
self->wm->target_surface->width,
- self->wm->target_surface->height, 0, 0);
+ self->wm->target_surface->height,
+ del_list);
self->wm->target_surface->tab_stop = 1;
+ list_clear(del_list);
}
libxrdp_orders_send_switch_os_surface(self->session, surface_index);
self->wm->current_surface_index = surface_index;
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index a54fd85c..ce646a66 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -184,6 +184,7 @@ struct xrdp_cache
int brush_stamp;
struct xrdp_brush_item brush_items[64];
struct xrdp_os_bitmap_item os_bitmap_items[2000];
+ struct list* xrdp_os_del_list;
};
struct xrdp_mm