From 154a1c895a0bec1114d302e080c284e9301026d2 Mon Sep 17 00:00:00 2001 From: Jeroen Meijer Date: Fri, 20 May 2005 22:09:32 +0000 Subject: [PATCH] Tell the server to stop sending window updates when the rdesktop window is unmapped git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@904 423420c4-83ab-492f-b58f-81f9feb106b5 --- constants.h | 1 + proto.h | 1 + rdp.c | 29 +++++++++++++++++++++++++++-- rdp5.c | 8 ++++---- xwin.c | 8 +++++++- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/constants.h b/constants.h index 0b088b9..ce54e5a 100644 --- a/constants.h +++ b/constants.h @@ -118,6 +118,7 @@ enum RDP_DATA_PDU_TYPE RDP_DATA_PDU_INPUT = 28, RDP_DATA_PDU_SYNCHRONISE = 31, RDP_DATA_PDU_BELL = 34, + RDP_DATA_PDU_CLIENT_WINDOW_STATUS = 35, RDP_DATA_PDU_LOGON = 38, RDP_DATA_PDU_FONT2 = 39, RDP_DATA_PDU_KEYBOARD_INDICATORS = 41, diff --git a/proto.h b/proto.h index 051ce5c..088668d 100644 --- a/proto.h +++ b/proto.h @@ -100,6 +100,7 @@ void rdp_out_unistr(STREAM s, char *string, int len); int rdp_in_unistr(STREAM s, char *string, int uni_len); void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2); +void rdp_send_client_window_status(int status); void process_colour_pointer_pdu(STREAM s); void process_cached_pointer_pdu(STREAM s); void process_system_pointer_pdu(STREAM s); diff --git a/rdp.c b/rdp.c index cc3304a..4111895 100644 --- a/rdp.c +++ b/rdp.c @@ -49,7 +49,6 @@ extern int g_width; extern int g_height; extern BOOL g_bitmap_cache; extern BOOL g_bitmap_cache_persist_enable; -extern BOOL g_rdp_compression; uint8 *g_next_packet; uint32 g_rdp_shareid; @@ -482,7 +481,33 @@ rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 par rdp_send_data(s, RDP_DATA_PDU_INPUT); } -/* Inform the server on the contents of the persistent bitmap cache */ +/* Send a client window information PDU */ +void +rdp_send_client_window_status(int status) +{ + STREAM s; + + s = rdp_init_data(12); + + out_uint32_le(s, status); + + switch (status) + { + case 0: /* shut the server up */ + break; + + case 1: /* receive data again */ + out_uint32_le(s, 0); /* unknown */ + out_uint16_le(s, g_width); + out_uint16_le(s, g_height); + break; + } + + s_mark_end(s); + rdp_send_data(s, RDP_DATA_PDU_CLIENT_WINDOW_STATUS); +} + +/* Send persistent bitmap cache enumeration PDU's */ static void rdp_enum_bmpcache2(void) { diff --git a/rdp5.c b/rdp5.c index 9f4be79..78d9716 100644 --- a/rdp5.c +++ b/rdp5.c @@ -94,21 +94,21 @@ rdp5_process(STREAM s) break; case 3: /* update synchronize */ break; - case 5: /* null pointer */ + case 5: /* null pointer */ ui_set_null_cursor(); break; case 6: /* default pointer */ break; - case 8: /* pointer position */ + case 8: /* pointer position */ in_uint16_le(ts, x); in_uint16_le(ts, y); if (s_check(ts)) ui_move_pointer(x, y); break; - case 9: /* color pointer */ + case 9: /* color pointer */ process_colour_pointer_pdu(ts); break; - case 10: /* cached pointer */ + case 10: /* cached pointer */ process_cached_pointer_pdu(ts); break; default: diff --git a/xwin.c b/xwin.c index 16d65d8..7ce91a0 100644 --- a/xwin.c +++ b/xwin.c @@ -1227,7 +1227,7 @@ ui_create_window(void) } input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | - VisibilityChangeMask | FocusChangeMask; + VisibilityChangeMask | FocusChangeMask | StructureNotifyMask; if (g_sendmotion) input_mask |= PointerMotionMask; @@ -1599,6 +1599,12 @@ xwin_process_events(void) case PropertyNotify: xclip_handle_PropertyNotify(&xevent.xproperty); break; + case MapNotify: + rdp_send_client_window_status(1); + break; + case UnmapNotify: + rdp_send_client_window_status(0); + break; } } /* Keep going */