Detect focus changes and send FOCUS to the server.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/branches/seamlessrdp-branch/rdesktop@1153 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Pierre Ossman 2006-03-17 09:56:20 +00:00
parent 8d65411c21
commit b899e2f50f
3 changed files with 17 additions and 0 deletions

View File

@ -289,6 +289,7 @@ BOOL seamless_init(void);
void seamless_send_sync(void);
void seamless_send_state(unsigned long id, unsigned int state, unsigned long flags);
void seamless_send_zchange(unsigned long id, unsigned long below, unsigned long flags);
void seamless_send_focus(unsigned long id, unsigned long flags);
/* *INDENT-OFF* */
#ifdef __cplusplus

View File

@ -347,3 +347,13 @@ seamless_send_zchange(unsigned long id, unsigned long below, unsigned long flags
seamless_send("ZCHANGE,0x%08lx,0x%08lx,0x%lx\n", id, below, flags);
}
void
seamless_send_focus(unsigned long id, unsigned long flags)
{
if (!g_seamless_rdp)
return;
seamless_send("FOCUS,0x%08lx,0x%lx\n", id, flags);
}

6
xwin.c
View File

@ -1912,6 +1912,12 @@ xwin_process_events(void)
if (g_grab_keyboard && g_mouse_in_wnd)
XGrabKeyboard(g_display, g_wnd, True,
GrabModeAsync, GrabModeAsync, CurrentTime);
sw = seamless_get_window_by_wnd(xevent.xfocus.window);
if (!sw)
break;
seamless_send_focus(sw->id, 0);
break;
case FocusOut: