MCPcopy Create free account
hub / github.com/clementgallet/libTAS / haveFocus

Method haveFocus

src/program/GameEventsXcb.cpp:206–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206bool GameEventsXcb::haveFocus()
207{
208 xcb_window_t window;
209
210 xcb_generic_error_t* error;
211 xcb_get_input_focus_cookie_t focus_cookie = xcb_get_input_focus(context->conn);
212 xcb_get_input_focus_reply_t* focus_reply = xcb_get_input_focus_reply(context->conn, focus_cookie, &error);
213 if (error) {
214 std::cerr << "Could not get focussed window, X error" << error->error_code << std::endl;
215 }
216
217 window = focus_reply->focus;
218 free(focus_reply);
219
220 return (window == context->game_window) || (window == parent_game_window);
221}

Callers 2

sleepSendPreviewMethod · 0.80
processInputsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected