void _xcb_im_handle_open(xcb_im_t* im, xcb_im_client_t* client, const xcb_im_packet_header_fr_t* hdr, uint8_t* data) { xcb_im_open_fr_t frame; _xcb_im_read_frame_with_error(im, client, frame, data, XIM_MESSAGE_BYTES(hdr)); if (im->callback) { im->callback(im, client, NULL, hdr, &frame, NULL, im->user_data); } xcb_im_open_fr_free(&frame); /*endif*/ if (im->onKeys.nKeys || im->offKeys.nKeys) { _xcb_im_send_trigger_key(im, client); } xcb_im_open_reply_fr_t reply_frame; reply_frame.input_method_ID = client->connect_id; reply_frame.IM_attribute_supported.size = ARRAY_SIZE(im->imattr); reply_frame.IC_attribute_supported.size = ARRAY_SIZE(im->icattr); reply_frame.IM_attribute_supported.items = im->imattr; reply_frame.IC_attribute_supported.items = im->icattr; _xcb_im_send_frame(im, client, reply_frame, true); }
void _xcb_im_handle_open(xcb_im_t* im, xcb_im_client_table_t* client, const xcb_im_proto_header_t* hdr, uint8_t* data, bool *del) { size_t len = XIM_MESSAGE_BYTES(hdr); open_fr frame; open_fr_read(&frame, &data, &len, client->c.byte_order != im->byte_order); if (!data) { open_fr_free(&frame); return; } if (im->callback) { im->callback(im, &client->c, hdr, &frame, im->user_data); } open_fr_free(&frame); /*endif*/ if (im->onKeys.nKeys || im->offKeys.nKeys) { _xcb_im_send_trigger_key(im, client); } open_reply_fr reply_frame; reply_frame.input_method_ID = client->c.connect_id; reply_frame.IM_attribute_supported.size = ARRAY_SIZE(im->imattr); reply_frame.IC_attribute_supported.size = ARRAY_SIZE(im->icattr); reply_frame.IM_attribute_supported.items = im->imattr; reply_frame.IC_attribute_supported.items = im->icattr; xim_send_frame(reply_frame, open_reply_fr, XIM_OPEN_REPLY); }