From d7b4d8fe8250bdb734a63d0694f1c1153909692a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Oct 2015 13:11:21 +0200 Subject: [PATCH] Move functionality for geom_before_block to AbstractClient Semantically it belongs together with geometry update blocking which is already in AbstractClient. --- abstract_client.cpp | 5 +++++ abstract_client.h | 5 +++++ client.h | 1 - geometry.cpp | 12 ++++++------ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index 45158f0dae..6bf34fcbe5 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -1046,4 +1046,9 @@ void AbstractClient::addRepaintDuringGeometryUpdates() m_visibleRectBeforeGeometryUpdate = deco_rect; } +void AbstractClient::updateGeometryBeforeUpdateBlocking() +{ + m_geometryBeforeUpdateBlocking = geom; +} + } diff --git a/abstract_client.h b/abstract_client.h index ccc6722020..f57a835eaa 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -577,6 +577,10 @@ protected: }; PendingGeometry_t pendingGeometryUpdate() const; void setPendingGeometryUpdate(PendingGeometry_t update); + QRect geometryBeforeUpdateBlocking() const { + return m_geometryBeforeUpdateBlocking; + } + void updateGeometryBeforeUpdateBlocking(); /** * Schedules a repaint for the visibleRect before and after a * geometry update. The current visibleRect is stored for the @@ -628,6 +632,7 @@ private: PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone; friend class GeometryUpdatesBlocker; QRect m_visibleRectBeforeGeometryUpdate; + QRect m_geometryBeforeUpdateBlocking; }; /** diff --git a/client.h b/client.h index d7be3182b0..604ceb4d07 100644 --- a/client.h +++ b/client.h @@ -698,7 +698,6 @@ private: xcb_timestamp_t m_userTime; NET::Actions allowed_actions; QSize client_size; - QRect geom_before_block; bool shade_geometry_change; struct { xcb_sync_counter_t counter; diff --git a/geometry.cpp b/geometry.cpp index 739d6c5f70..bd90583c78 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1925,7 +1925,7 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) return; } QSize oldClientSize = m_frame.geometry().size(); - bool resized = (geom_before_block.size() != geom.size() || pendingGeometryUpdate() == PendingGeometryForced); + bool resized = (geometryBeforeUpdateBlocking().size() != geom.size() || pendingGeometryUpdate() == PendingGeometryForced); if (resized) { resizeDecoration(); m_frame.setGeometry(x, y, w, h); @@ -1967,10 +1967,10 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) if (resized) { if (oldClientSize != QSize(w,h)) discardWindowPixmap(); - emit geometryShapeChanged(this, geom_before_block); + emit geometryShapeChanged(this, geometryBeforeUpdateBlocking()); } addRepaintDuringGeometryUpdates(); - geom_before_block = geom; + updateGeometryBeforeUpdateBlocking(); // Update states of all other windows in this group if (tabGroup()) @@ -2030,9 +2030,9 @@ void Client::plainResize(int w, int h, ForceGeometry_t force) workspace()->updateStackingOrder(); if (oldClientSize != QSize(w,h)) discardWindowPixmap(); - emit geometryShapeChanged(this, geom_before_block); + emit geometryShapeChanged(this, geometryBeforeUpdateBlocking()); addRepaintDuringGeometryUpdates(); - geom_before_block = geom; + updateGeometryBeforeUpdateBlocking(); // Update states of all other windows in this group if (tabGroup()) @@ -2075,7 +2075,7 @@ void Client::move(int x, int y, ForceGeometry_t force) } // client itself is not damaged addRepaintDuringGeometryUpdates(); - geom_before_block = geom; + updateGeometryBeforeUpdateBlocking(); // Update states of all other windows in this group if (tabGroup())