static BOOL xf_event_FocusIn(xfContext* xfc, XEvent* event, BOOL app) { if (event->xfocus.mode == NotifyGrab) return TRUE; xfc->focused = TRUE; if (xfc->mouse_active && !app) XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, GrabModeAsync, CurrentTime); if (app) { xfAppWindow* appWindow; xf_rail_send_activate(xfc, event->xany.window, TRUE); appWindow = xf_AppWindowFromX11Window(xfc, event->xany.window); /* Update the server with any window changes that occurred while the window was not focused. */ if (appWindow) { xf_rail_adjust_position(xfc, appWindow); } } xf_keyboard_focus_in(xfc); return TRUE; }
static BOOL xf_event_FocusIn(xfInfo* xfi, XEvent* event, BOOL app) { if (event->xfocus.mode == NotifyGrab) return TRUE; xfi->focused = TRUE; if (xfi->mouse_active && (!app)) XGrabKeyboard(xfi->display, xfi->window->handle, TRUE, GrabModeAsync, GrabModeAsync, CurrentTime); if (app) { xf_rail_send_activate(xfi, event->xany.window, TRUE); rdpWindow* window; rdpRail* rail = ((rdpContext*) xfi->context)->rail; window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window); /* Update the server with any window changes that occured while the window was not focused. */ if (window != NULL) xf_rail_adjust_position(xfi, window); } xf_kbd_focus_in(xfi); if (!app) xf_cliprdr_check_owner(xfi); return TRUE; }
boolean xf_event_FocusOut(xfInfo* xfi, XEvent* event, boolean app) { if (event->xfocus.mode == NotifyUngrab) return true; xfi->focused = false; if (event->xfocus.mode == NotifyWhileGrabbed) XUngrabKeyboard(xfi->display, CurrentTime); if (app) xf_rail_send_activate(xfi, event->xany.window, false); return true; }
static BOOL xf_event_FocusOut(xfContext* xfc, XEvent* event, BOOL app) { if (event->xfocus.mode == NotifyUngrab) return TRUE; xfc->focused = FALSE; if (event->xfocus.mode == NotifyWhileGrabbed) XUngrabKeyboard(xfc->display, CurrentTime); xf_keyboard_clear(xfc); if (app) xf_rail_send_activate(xfc, event->xany.window, FALSE); return TRUE; }
boolean xf_event_FocusIn(xfInfo* xfi, XEvent* event, boolean app) { if (event->xfocus.mode == NotifyGrab) return true; xfi->focused = true; if (xfi->mouse_active && (app != true)) XGrabKeyboard(xfi->display, xfi->window->handle, true, GrabModeAsync, GrabModeAsync, CurrentTime); if (app) xf_rail_send_activate(xfi, event->xany.window, true); xf_kbd_focus_in(xfi); if (app != true) xf_cliprdr_check_owner(xfi); return true; }