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.
This commit is contained in:
Vlad Zahorodnii 2021-08-27 10:12:49 +03:00
parent 894ed68ff4
commit ff87b33a8a
4 changed files with 7 additions and 9 deletions

View file

@ -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();

View file

@ -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()) {

View file

@ -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) {

View file

@ -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()