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
This commit is contained in:
Jeroen Meijer 2005-05-20 22:09:32 +00:00
parent 04818ca41e
commit 154a1c895a
5 changed files with 40 additions and 7 deletions

View File

@ -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,

View File

@ -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);

29
rdp.c
View File

@ -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)
{

8
xwin.c
View File

@ -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 */