From 62b640117525b72133d38454c66ed6b5205e064b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 2 Aug 2015 14:27:37 +0200 Subject: [PATCH] store logic (what we think) geometry of XCB Window This allows us to check and compare geometry of system windows, no matter what the interim logic client geometry (eg. shaded etc.) is REVIEW: 124591 --- xcbutils.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xcbutils.h b/xcbutils.h index 78ce467201..9f9f35d165 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -1385,6 +1385,7 @@ public: * Configures the window with a new geometry. * @param geometry The new window geometry to be used **/ + inline const QRect &geometry() const { return m_logicGeometry; } void setGeometry(const QRect &geometry); void setGeometry(uint32_t x, uint32_t y, uint32_t width, uint32_t height); void move(const QPoint &pos); @@ -1419,6 +1420,7 @@ public: void kill(); operator xcb_window_t() const; private: + QRect m_logicGeometry; xcb_window_t doCreate(const QRect &geometry, uint16_t windowClass, uint32_t mask = 0, const uint32_t *values = NULL, xcb_window_t parent = rootWindow()); void destroy(); xcb_window_t m_window; @@ -1490,6 +1492,7 @@ void Window::create(const QRect &geometry, uint32_t mask, const uint32_t *values inline xcb_window_t Window::doCreate(const QRect &geometry, uint16_t windowClass, uint32_t mask, const uint32_t *values, xcb_window_t parent) { + m_logicGeometry = geometry; xcb_window_t w = xcb_generate_id(connection()); xcb_create_window(connection(), XCB_COPY_FROM_PARENT, w, parent, geometry.x(), geometry.y(), geometry.width(), geometry.height(), @@ -1514,6 +1517,7 @@ void Window::setGeometry(const QRect &geometry) inline void Window::setGeometry(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { + m_logicGeometry.setRect(x, y, width, height); if (!isValid()) { return; } @@ -1531,6 +1535,7 @@ void Window::move(const QPoint &pos) inline void Window::move(uint32_t x, uint32_t y) { + m_logicGeometry.moveTo(x, y); if (!isValid()) { return; } @@ -1546,6 +1551,7 @@ void Window::resize(const QSize &size) inline void Window::resize(uint32_t width, uint32_t height) { + m_logicGeometry.setSize(QSize(width, height)); if (!isValid()) { return; }