diff --git a/proto.h b/proto.h index 5762cf0..6ac2416 100644 --- a/proto.h +++ b/proto.h @@ -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 diff --git a/seamless.c b/seamless.c index 0eb2893..b407f54 100644 --- a/seamless.c +++ b/seamless.c @@ -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); +} diff --git a/xwin.c b/xwin.c index 423ecde..40bf85b 100644 --- a/xwin.c +++ b/xwin.c @@ -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: