diff options
author | Jim Grandy <jgrandy@authentic8.com> | 2013-06-30 16:12:09 -0700 |
---|---|---|
committer | Jim Grandy <jgrandy@authentic8.com> | 2013-08-22 12:49:40 -0700 |
commit | 2036010e0c5f382dddad6a9760dfc6f7890b898c (patch) | |
tree | 4a486188bfb27ba1e9673d29132e4b3680e93ead /sesman/chansrv | |
parent | 53311f2b2542dc9ada5a26f1dc3feae7ece4435f (diff) | |
download | xrdp-proprietary-2036010e0c5f382dddad6a9760dfc6f7890b898c.tar.gz xrdp-proprietary-2036010e0c5f382dddad6a9760dfc6f7890b898c.zip |
Hand-apply patches (rail improvements) from Authentic8 branch: 6d97878
Diffstat (limited to 'sesman/chansrv')
-rw-r--r-- | sesman/chansrv/rail.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sesman/chansrv/rail.c b/sesman/chansrv/rail.c index ff926177..b74c3a8b 100644 --- a/sesman/chansrv/rail.c +++ b/sesman/chansrv/rail.c @@ -28,6 +28,7 @@ #include "log.h" #include "os_calls.h" #include "thread_calls.h" +#include "list.h" extern int g_rail_chan_id; /* in chansrv.c */ extern int g_display_num; /* in chansrv.c */ @@ -49,6 +50,8 @@ int g_rail_up = 0; /* for rail_is_another_wm_running */ static int g_rail_running = 1; +/* list of valid rail windows */ +static struct list* g_window_list = 0; /* Indicates a Client Execute PDU from client to server. */ #define TS_RAIL_ORDER_EXEC 0x0001 @@ -219,7 +222,8 @@ rail_init(void) log_message(LOG_LEVEL_ERROR, "rail_init: another window manager " "is running"); } - + list_delete(g_window_list); + g_window_list = list_create(); rail_send_init(); g_rail_up = 1; return 0; @@ -231,6 +235,8 @@ rail_deinit(void) { if (g_rail_up) { + list_delete(g_window_list); + g_window_list = 0; /* no longer window manager */ XSelectInput(g_display, g_root_window, 0); g_rail_up = 0; @@ -1051,6 +1057,7 @@ rail_xevent(void *xevent) XEvent *lxevent; XWindowChanges xwc; int rv; + int index; XWindowAttributes wnd_attributes; char* prop_name; @@ -1105,17 +1112,18 @@ rail_xevent(void *xevent) XSelectInput(g_display, lxevent->xcreatewindow.window, PropertyChangeMask | StructureNotifyMask); rail_win_set_state(lxevent->xcreatewindow.window, 0x0); /* WithdrawnState */ + list_add_item(g_window_list, lxevent->xcreatewindow.window); rv = 0; break; case DestroyNotify: LOG(10, (" got DestroyNotify 0x%8.8x", lxevent->xdestroywindow.window)); - /* - * FIXME The destroy msg may be sent from a non-rail window. Ideally, - * this will be handled by client, but we better have to maintain - * a list of managed rail windows here. - */ - rail_destroy_window(lxevent->xdestroywindow.window); + index = list_index_of(g_window_list, lxevent->xdestroywindow.window); + if (index >= 0) + { + rail_destroy_window(lxevent->xdestroywindow.window); + list_remove_item(g_window_list, index); + } v = 0; break; |