add xcb_set_window_rect which configures a window according to a Rect

This commit is contained in:
Michael Stapelberg
2010-02-28 20:35:30 +01:00
parent 7caf98dd18
commit 6f72970ece
4 changed files with 30 additions and 29 deletions

@ -3,7 +3,7 @@
*
* i3 - an improved dynamic tiling window manager
*
* © 2009 Michael Stapelberg and contributors
* © 2009-2010 Michael Stapelberg and contributors
*
* See file LICENSE for license information.
*
@ -375,3 +375,16 @@ int predict_text_width(xcb_connection_t *conn, const char *font_pattern, char *t
return width;
}
/*
* Configures the given window to have the size/position specified by given rect
*
*/
void xcb_set_window_rect(xcb_connection_t *conn, xcb_window_t window, Rect r) {
xcb_configure_window(conn, window,
XCB_CONFIG_WINDOW_X |
XCB_CONFIG_WINDOW_Y |
XCB_CONFIG_WINDOW_WIDTH |
XCB_CONFIG_WINDOW_HEIGHT,
&(r.x));
}