743
754
return !state.have_error;
758
roundtrip_callback_idle (gpointer data)
760
RoundtripState *state = (RoundtripState *)data;
762
state->callback (state->display, state->data, state->get_input_focus_req);
770
roundtrip_handler (Display *dpy,
776
RoundtripState *state = (RoundtripState *)data;
778
if (dpy->last_request_read == state->get_input_focus_req)
780
xGetInputFocusReply replbuf;
781
xGetInputFocusReply *repl;
783
if (rep->generic.type != X_Error)
785
/* Actually does nothing, since there are no additional bytes
786
* to read, but maintain good form.
788
repl = (xGetInputFocusReply *)
789
_XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len,
790
(sizeof(xGetInputFocusReply) - sizeof(xReply)) >> 2,
796
gdk_threads_add_idle (roundtrip_callback_idle, state);
798
DeqAsyncHandler(state->dpy, &state->async);
800
return (rep->generic.type != X_Error);
807
_gdk_x11_roundtrip_async (GdkDisplay *display,
808
GdkRoundTripCallback callback,
812
RoundtripState *state;
814
dpy = GDK_DISPLAY_XDISPLAY (display);
816
state = g_new (RoundtripState, 1);
818
state->display = display;
820
state->callback = callback;
825
state->async.next = dpy->async_handlers;
826
state->async.handler = roundtrip_handler;
827
state->async.data = (XPointer) state;
828
dpy->async_handlers = &state->async;
836
GetEmptyReq(GetInputFocus, req);
837
state->get_input_focus_req = dpy->request;
746
844
#define __GDK_ASYNC_C__
747
845
#include "gdkaliasdef.c"