diff --git a/doc/seamlessrdp-channel.txt b/doc/seamlessrdp-channel.txt index 8a8ab11..894eb08 100644 --- a/doc/seamlessrdp-channel.txt +++ b/doc/seamlessrdp-channel.txt @@ -55,13 +55,20 @@ CREATE Allocate structures for a new window. Syntax: - CREATE,,,, + CREATE,,,,, Indicates that a window has appeared on the server. If PARENT is non-zero then the new window is a child of that window (it's transient for it). The special value 0xFFFFFFFF for PARENT means that the window is a popup window without a parent. It's commonly used for splash screens, tool tips and context menus. +The group id identifies a set of windows that belong together. It is currently +only used for modal windows and DESTROYGRP. + +Flags: + 0x0001 : Create a window that's modal with regard to the other windows + in the same group. + Note that very little information is included in this message. Things like title and state will come in subsequent messages. This message should only be used to allocate data structures for the new window. @@ -76,6 +83,17 @@ Syntax: Remove the window and deallocate all associated structures. +DESTROYGRP +---------- + +Destroy an entire group of windows. + +Syntax: + DESTROYGRP,,, + +Every window that belongs to the group GRPID should be destroyed as if they +each got a DESTROY message. + POSITION -------- diff --git a/proto.h b/proto.h index 882c0c8..e809304 100644 --- a/proto.h +++ b/proto.h @@ -101,8 +101,8 @@ void printercache_process(STREAM s); /* pstcache.c */ void pstcache_touch_bitmap(uint8 cache_id, uint16 cache_idx, uint32 stamp); BOOL pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx); -BOOL pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * key, uint8 width, - uint8 height, uint16 length, uint8 * data); +BOOL pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * key, uint8 width, uint8 height, + uint16 length, uint8 * data); int pstcache_enumerate(uint8 id, HASH_KEY * keylist); BOOL pstcache_init(uint8 cache_id); /* rdesktop.c */ @@ -283,6 +283,7 @@ void ui_seamless_toggle(void); void ui_seamless_create_window(unsigned long id, unsigned long group, unsigned long parent, unsigned long flags); void ui_seamless_destroy_window(unsigned long id, unsigned long flags); +void ui_seamless_destroy_group(unsigned long id, unsigned long flags); void ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags); void ui_seamless_restack_window(unsigned long id, unsigned long behind, unsigned long flags); diff --git a/seamless.c b/seamless.c index 4c97cec..9b12d4c 100644 --- a/seamless.c +++ b/seamless.c @@ -120,6 +120,21 @@ seamless_process_line(const char *line, void *data) ui_seamless_destroy_window(id, flags); } + else if (!strcmp("DESTROYGRP", tok1)) + { + if (!tok4) + return False; + + id = strtoul(tok3, &endptr, 0); + if (*endptr) + return False; + + flags = strtoul(tok4, &endptr, 0); + if (*endptr) + return False; + + ui_seamless_destroy_group(id, flags); + } else if (!strcmp("SETICON", tok1)) { unimpl("SeamlessRDP SETICON1\n"); diff --git a/xwin.c b/xwin.c index 2eb654e..572aac9 100644 --- a/xwin.c +++ b/xwin.c @@ -3473,6 +3473,27 @@ ui_seamless_destroy_window(unsigned long id, unsigned long flags) } +void +ui_seamless_destroy_group(unsigned long id, unsigned long flags) +{ + seamless_window *sw, *sw_next; + + if (!g_seamless_active) + return; + + for (sw = g_seamless_windows; sw; sw = sw_next) + { + sw_next = sw->next; + + if (sw->group->id == id) + { + XDestroyWindow(g_display, sw->wnd); + sw_remove_window(sw); + } + } +} + + void ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags) {