Commit 58af3e82 authored by David Edmundson's avatar David Edmundson
Browse files

Only commit XdgOutput::done if changed

Summary:
XdgOutput no-ops if one calls setLogicalSize(someSize)  and someSize
matches the last sent size

However, as we have an explicit done signal, we currently end up sending
this regardless.

This patches tracks if we've made any changes to commit in the done
event.

CCBUG: 400987

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19255
parent 1cb96f64
......@@ -80,6 +80,7 @@ public:
void resourceDisconnected(XdgOutputV1Interface *resource);
QPoint pos;
QSize size;
bool dirty = false;
bool doneOnce = false;
QList<XdgOutputV1Interface*> resources;
};
......@@ -187,6 +188,7 @@ void XdgOutputInterface::setLogicalSize(const QSize &size)
return;
}
d->size = size;
d->dirty = true;
for(auto resource: d->resources) {
resource->setLogicalSize(size);
}
......@@ -203,6 +205,7 @@ void XdgOutputInterface::setLogicalPosition(const QPoint &pos)
return;
}
d->pos = pos;
d->dirty = true;
for(auto resource: d->resources) {
resource->setLogicalPosition(pos);
}
......@@ -216,6 +219,10 @@ QPoint XdgOutputInterface::logicalPosition() const
void XdgOutputInterface::done()
{
d->doneOnce = true;
if (!d->dirty) {
return;
}
d->dirty = false;
for(auto resource: d->resources) {
resource->done();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment