Add setBorderWidth() method to Xcb::Window

Performs the configure window call.
This commit is contained in:
Martin Gräßlin 2013-09-10 09:51:31 +02:00
parent 592ea89b01
commit 3ee886be2d
3 changed files with 12 additions and 8 deletions

View file

@ -741,14 +741,8 @@ void Client::configureRequestEvent(xcb_configure_request_event_t *e)
} }
if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) { if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) {
// TODO: port to XCB
// first, get rid of a window border // first, get rid of a window border
XWindowChanges wc; m_client.setBorderWidth(0);
unsigned int value_mask = 0;
wc.border_width = 0;
value_mask = XCB_CONFIG_WINDOW_BORDER_WIDTH;
XConfigureWindow(display(), window(), value_mask, & wc);
} }
if (e->value_mask & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH)) if (e->value_mask & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH))

View file

@ -643,7 +643,7 @@ void Client::embedClient(xcb_window_t w, const XWindowAttributes& attr)
m_client.selectInput(zero_value); m_client.selectInput(zero_value);
m_client.unmap(); m_client.unmap();
xcb_configure_window(conn, m_client, XCB_CONFIG_WINDOW_BORDER_WIDTH, &zero_value); m_client.setBorderWidth(zero_value);
// Note: These values must match the order in the xcb_cw_t enum // Note: These values must match the order in the xcb_cw_t enum
const uint32_t cw_values[] = { const uint32_t cw_values[] = {

View file

@ -437,6 +437,7 @@ public:
void unmap(); void unmap();
void reparent(xcb_window_t parent, int x = 0, int y = 0); void reparent(xcb_window_t parent, int x = 0, int y = 0);
void deleteProperty(xcb_atom_t property); void deleteProperty(xcb_atom_t property);
void setBorderWidth(uint32_t width);
/** /**
* Clears the window area. Same as xcb_clear_area with x, y, width, height being @c 0. * Clears the window area. Same as xcb_clear_area with x, y, width, height being @c 0.
**/ **/
@ -633,6 +634,15 @@ void Window::deleteProperty(xcb_atom_t property)
xcb_delete_property(connection(), m_window, property); xcb_delete_property(connection(), m_window, property);
} }
inline
void Window::setBorderWidth(uint32_t width)
{
if (!isValid()) {
return;
}
xcb_configure_window(connection(), m_window, XCB_CONFIG_WINDOW_BORDER_WIDTH, &width);
}
inline inline
void Window::clear() void Window::clear()
{ {