From 0d9ab277989a46a8e365bdb731826fdd10784e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 10 Sep 2013 07:38:21 +0200 Subject: [PATCH] Use the wrapper methods for Client::m_client instead of xcb_foo --- client.cpp | 12 ++++++------ manage.cpp | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client.cpp b/client.cpp index 7277b33c0b..6a39121c95 100644 --- a/client.cpp +++ b/client.cpp @@ -289,14 +289,14 @@ void Client::releaseWindow(bool on_shutdown) xcb_delete_property(c, m_client, atoms->kde_net_wm_frame_strut); xcb_reparent_window(c, m_client, rootWindow(), x(), y()); xcb_change_save_set(c, XCB_SET_MODE_DELETE, m_client); - Xcb::selectInput(m_client, XCB_EVENT_MASK_NO_EVENT); + m_client.selectInput(XCB_EVENT_MASK_NO_EVENT); if (on_shutdown) // Map the window, so it can be found after another WM is started - xcb_map_window(connection(), m_client); + m_client.map(); // TODO: Preserve minimized, shaded etc. state? else // Make sure it's not mapped if the app unmapped it (#65279). The app // may do map+unmap before we initially map the window by calling rawShow() from manage(). - xcb_unmap_window(connection(), m_client); + m_client.unmap(); m_client.reset(); m_wrapper.reset(); XDestroyWindow(display(), frameId()); @@ -962,7 +962,7 @@ void Client::setShade(ShadeMode mode) s.setHeight(border_top + border_bottom); m_wrapper.selectInput(ClientWinMask); // Avoid getting UnmapNotify m_wrapper.unmap(); - xcb_unmap_window(connection(), m_client); + m_client.unmap(); m_wrapper.selectInput(ClientWinMask | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY); exportMappingState(IconicState); plainResize(s); @@ -1190,7 +1190,7 @@ void Client::map() XMapWindow(display(), frameId()); if (!isShade()) { m_wrapper.map(); - xcb_map_window(connection(), m_client); + m_client.map(); m_decoInputExtent.map(); exportMappingState(NormalState); } else @@ -1211,7 +1211,7 @@ void Client::unmap() m_wrapper.selectInput(ClientWinMask); // Avoid getting UnmapNotify XUnmapWindow(display(), frameId()); m_wrapper.unmap(); - xcb_unmap_window(connection(), m_client); + m_client.unmap(); m_decoInputExtent.unmap(); m_wrapper.selectInput(ClientWinMask | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY); if (decoration != NULL) diff --git a/manage.cpp b/manage.cpp index 2fb6603204..187c82ecde 100644 --- a/manage.cpp +++ b/manage.cpp @@ -641,8 +641,8 @@ void Client::embedClient(xcb_window_t w, const XWindowAttributes& attr) // We don't want the window to be destroyed when we quit xcb_change_save_set(conn, XCB_SET_MODE_INSERT, m_client); - xcb_change_window_attributes(conn, m_client, XCB_CW_EVENT_MASK, &zero_value); - xcb_unmap_window(conn, m_client); + m_client.selectInput(zero_value); + m_client.unmap(); xcb_configure_window(conn, m_client, XCB_CONFIG_WINDOW_BORDER_WIDTH, &zero_value); // Note: These values must match the order in the xcb_cw_t enum @@ -693,7 +693,7 @@ void Client::embedClient(xcb_window_t w, const XWindowAttributes& attr) // receiving any unexpected events from the wrapper creation or the reparenting. xcb_change_window_attributes(conn, frame, XCB_CW_EVENT_MASK, &frame_event_mask); xcb_change_window_attributes(conn, m_wrapper, XCB_CW_EVENT_MASK, &wrapper_event_mask); - xcb_change_window_attributes(conn, m_client, XCB_CW_EVENT_MASK, &client_event_mask); + m_client.selectInput(client_event_mask); updateMouseGrab(); }