From 24688f8dae1350d54060099b9683c9dffe3e53b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Jan 2015 15:38:21 +0100 Subject: [PATCH] Split Client::detectGtkFrameExtents into two parts --- client.cpp | 14 ++++++++++++-- client.h | 2 ++ manage.cpp | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/client.cpp b/client.cpp index 12fbd5083c..acc98f730e 100644 --- a/client.cpp +++ b/client.cpp @@ -659,13 +659,23 @@ void Client::updateFrameExtents() info->setFrameExtents(strut); } -void Client::detectGtkFrameExtents() +Xcb::Property Client::fetchGtkFrameExtents() const +{ + return Xcb::Property(false, m_client, atoms->gtk_frame_extents, XCB_ATOM_CARDINAL, 0, 4); +} + +void Client::readGtkFrameExtents(Xcb::Property &prop) { - Xcb::Property prop(false, m_client, atoms->gtk_frame_extents, XCB_ATOM_CARDINAL, 0, 4); m_clientSideDecorated = !prop.isNull() && prop->type != 0; emit clientSideDecoratedChanged(); } +void Client::detectGtkFrameExtents() +{ + Xcb::Property prop = fetchGtkFrameExtents(); + readGtkFrameExtents(prop); +} + /** * Resizes the decoration, and makes sure the decoration widget gets resize event * even if the size hasn't changed. This is needed to make sure the decoration diff --git a/client.h b/client.h index 0d31846c7b..13ff89b5c1 100644 --- a/client.h +++ b/client.h @@ -864,6 +864,8 @@ private: void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth); void detectNoBorder(); + Xcb::Property fetchGtkFrameExtents() const; + void readGtkFrameExtents(Xcb::Property &prop); void detectGtkFrameExtents(); void destroyDecoration(); void updateFrameExtents(); diff --git a/manage.cpp b/manage.cpp index 823ba5a95f..dc5a392788 100644 --- a/manage.cpp +++ b/manage.cpp @@ -99,6 +99,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) auto wmClientLeaderCookie = fetchWmClientLeader(); auto skipCloseAnimationCookie = fetchSkipCloseAnimation(); + auto gtkFrameExtentsCookie = fetchGtkFrameExtents(); info = new WinInfo(this, m_client, rootWindow(), properties, properties2); // If it's already mapped, ignore hint @@ -120,7 +121,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) if (Xcb::Extensions::self()->isShapeAvailable()) xcb_shape_select_input(connection(), window(), true); detectShape(window()); - detectGtkFrameExtents(); + readGtkFrameExtents(gtkFrameExtentsCookie); detectNoBorder(); fetchIconicName();