From ff87b33a8aaf3dd50bcd1e32d8b975b872994f8a Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 27 Aug 2021 10:12:49 +0300 Subject: [PATCH] Port away from EffectsHandler::screenGeometryChanged() to EffectsHandler::virtualScreenGeometryChanged() It's confusing to have two signals (virtualScreenGeometryChanged() and screenGeometryChanged()) that indicate the same thing. This change ports parts of kwin from the screenGeometryChanged() signal to the virtualScreenGeometryChanged() signal with the main motivation to drop the former. The virtualScreenGeometryChanged() signal was chosen as the replacement for the consistency sake with EffectsHandler's virtualScreenGeometry and virtualScreenSize properties. --- src/composite.cpp | 2 +- src/effects/backgroundcontrast/contrast.cpp | 2 +- src/effects/blur/blur.cpp | 2 +- src/plugins/platforms/x11/standalone/effects_x11.cpp | 10 ++++------ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/composite.cpp b/src/composite.cpp index f29f839685..4e6afc0593 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -336,7 +336,7 @@ void Compositor::startupWithWorkspace() // Sets also the 'effects' pointer. kwinApp()->platform()->createEffectsHandler(this, m_scene); connect(Workspace::self(), &Workspace::deletedRemoved, m_scene, &Scene::removeToplevel); - connect(effects, &EffectsHandler::screenGeometryChanged, this, &Compositor::addRepaintFull); + connect(effects, &EffectsHandler::virtualScreenGeometryChanged, this, &Compositor::addRepaintFull); for (X11Client *c : Workspace::self()->clientList()) { c->setupCompositing(); diff --git a/src/effects/backgroundcontrast/contrast.cpp b/src/effects/backgroundcontrast/contrast.cpp index c5f9c37045..d471549934 100644 --- a/src/effects/backgroundcontrast/contrast.cpp +++ b/src/effects/backgroundcontrast/contrast.cpp @@ -42,7 +42,7 @@ ContrastEffect::ContrastEffect() connect(effects, &EffectsHandler::windowAdded, this, &ContrastEffect::slotWindowAdded); connect(effects, &EffectsHandler::windowDeleted, this, &ContrastEffect::slotWindowDeleted); connect(effects, &EffectsHandler::propertyNotify, this, &ContrastEffect::slotPropertyNotify); - connect(effects, &EffectsHandler::screenGeometryChanged, this, &ContrastEffect::slotScreenGeometryChanged); + connect(effects, &EffectsHandler::virtualScreenGeometryChanged, this, &ContrastEffect::slotScreenGeometryChanged); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this] { if (shader && shader->isValid()) { diff --git a/src/effects/blur/blur.cpp b/src/effects/blur/blur.cpp index ea4e5465cb..ea987514c5 100644 --- a/src/effects/blur/blur.cpp +++ b/src/effects/blur/blur.cpp @@ -52,7 +52,7 @@ BlurEffect::BlurEffect() connect(effects, &EffectsHandler::windowAdded, this, &BlurEffect::slotWindowAdded); connect(effects, &EffectsHandler::windowDeleted, this, &BlurEffect::slotWindowDeleted); connect(effects, &EffectsHandler::propertyNotify, this, &BlurEffect::slotPropertyNotify); - connect(effects, &EffectsHandler::screenGeometryChanged, this, &BlurEffect::slotScreenGeometryChanged); + connect(effects, &EffectsHandler::virtualScreenGeometryChanged, this, &BlurEffect::slotScreenGeometryChanged); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this] { if (m_shader && m_shader->isValid() && m_renderTargetsValid) { diff --git a/src/plugins/platforms/x11/standalone/effects_x11.cpp b/src/plugins/platforms/x11/standalone/effects_x11.cpp index 7e0d9aa0fc..7faf5e9dfa 100644 --- a/src/plugins/platforms/x11/standalone/effects_x11.cpp +++ b/src/plugins/platforms/x11/standalone/effects_x11.cpp @@ -23,13 +23,11 @@ namespace KWin EffectsHandlerImplX11::EffectsHandlerImplX11(Compositor *compositor, Scene *scene) : EffectsHandlerImpl(compositor, scene) { - connect(this, &EffectsHandlerImpl::screenGeometryChanged, this, - [this] (const QSize &size) { - if (m_mouseInterceptionWindow.isValid()) { - m_mouseInterceptionWindow.setGeometry(QRect(0, 0, size.width(), size.height())); - } + connect(this, &EffectsHandlerImpl::virtualScreenGeometryChanged, this, [this]() { + if (m_mouseInterceptionWindow.isValid()) { + m_mouseInterceptionWindow.setGeometry(virtualScreenGeometry()); } - ); + }); } EffectsHandlerImplX11::~EffectsHandlerImplX11()