| 204 | } |
| 205 | |
| 206 | bool 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 | } |
no outgoing calls
no test coverage detected