Applied patch:

[ 1715358 ] seamlessrdp window close


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1446 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2008-03-07 11:27:12 +00:00
parent d7760c34fe
commit 8524a3fcf2
4 changed files with 25 additions and 7 deletions

View File

@ -324,6 +324,11 @@ Syntax:
Changes which window that will recieve the keyboard events. Note that this
might cause the window to change z order.
DESTROY
-------
Identical to the command sent from server to client.
Test Cases
==========
@ -390,5 +395,4 @@ Test Cases
* Test X11 window close: Start Notepad and open the Help
Browser. Close the Help Browser window on the X11 side using your
window manager. Verify that rdesktop still runs and that the Notepad
application window still exists. (currently fails, see patch
1715358)
application window still exists.

View File

@ -309,6 +309,7 @@ unsigned int seamless_send_position(unsigned long id, int x, int y, int width, i
void seamless_select_timeout(struct timeval *tv);
unsigned int seamless_send_zchange(unsigned long id, unsigned long below, unsigned long flags);
unsigned int seamless_send_focus(unsigned long id, unsigned long flags);
unsigned int seamless_send_destroy(unsigned long id);
/* scard.c */
void scard_lock(int lock);
void scard_unlock(int lock);

View File

@ -509,3 +509,10 @@ seamless_send_focus(unsigned long id, unsigned long flags)
return seamless_send("FOCUS", "0x%08lx,0x%lx", id, flags);
}
/* Send client-to-server message to destroy process on the server. */
unsigned int
seamless_send_destroy(unsigned long id)
{
return seamless_send("DESTROY", "0x%08lx", id);
}

14
xwin.c
View File

@ -2028,8 +2028,16 @@ xwin_process_events(void)
/* the window manager told us to quit */
if ((xevent.xclient.message_type == g_protocol_atom)
&& ((Atom) xevent.xclient.data.l[0] == g_kill_atom))
/* Quit */
{
/* When killing a seamless window, close the window on the
serverside instead of terminating rdesktop */
sw = sw_get_window_by_wnd(xevent.xclient.window);
if (!sw)
/* Otherwise, quit */
return 0;
/* send seamless destroy process message */
seamless_send_destroy(sw->id);
}
break;
case KeyPress:
@ -3465,9 +3473,7 @@ ui_seamless_create_window(unsigned long id, unsigned long group, unsigned long p
XSelectInput(g_display, wnd, input_mask);
/* handle the WM_DELETE_WINDOW protocol. FIXME: When killing a
seamless window, we could try to close the window on the
serverside, instead of terminating rdesktop */
/* handle the WM_DELETE_WINDOW protocol. */
XSetWMProtocols(g_display, wnd, &g_kill_atom, 1);
sw = xmalloc(sizeof(seamless_window));