Fake more configure notifies (makes xpdf work better)

This commit is contained in:
Michael Stapelberg
2009-03-13 00:39:16 +01:00
parent 89db5f7217
commit 14834c3530
5 changed files with 33 additions and 35 deletions

View File

@ -181,3 +181,29 @@ void xcb_draw_rect(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext
xcb_rectangle_t rect = {x, y, width, height};
xcb_poly_fill_rectangle(conn, drawable, gc, 1, &rect);
}
/*
* Generates a configure_notify event and sends it to the given window
* Applications need this to think theyve configured themselves correctly.
* The truth is, however, that we will manage them.
*
*/
void fake_configure_notify(xcb_connection_t *conn, Rect r, xcb_window_t window) {
xcb_configure_notify_event_t generated_event;
generated_event.event = window;
generated_event.window = window;
generated_event.response_type = XCB_CONFIGURE_NOTIFY;
generated_event.x = r.x;
generated_event.y = r.y;
generated_event.width = r.width;
generated_event.height = r.height;
generated_event.border_width = 0;
generated_event.above_sibling = XCB_NONE;
generated_event.override_redirect = false;
xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY, (char*)&generated_event);
xcb_flush(conn);
}