Changeset View
Changeset View
Standalone View
Standalone View
src/server/xdgoutput_interface.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | |||||
75 | 75 | | |||
76 | class XdgOutputInterface::Private | 76 | class XdgOutputInterface::Private | ||
77 | { | 77 | { | ||
78 | public: | 78 | public: | ||
79 | void resourceConnected(XdgOutputV1Interface *resource); | 79 | void resourceConnected(XdgOutputV1Interface *resource); | ||
80 | void resourceDisconnected(XdgOutputV1Interface *resource); | 80 | void resourceDisconnected(XdgOutputV1Interface *resource); | ||
81 | QPoint pos; | 81 | QPoint pos; | ||
82 | QSize size; | 82 | QSize size; | ||
83 | bool dirty = false; | ||||
83 | bool doneOnce = false; | 84 | bool doneOnce = false; | ||
84 | QList<XdgOutputV1Interface*> resources; | 85 | QList<XdgOutputV1Interface*> resources; | ||
85 | }; | 86 | }; | ||
86 | 87 | | |||
87 | 88 | | |||
88 | XdgOutputManagerInterface::XdgOutputManagerInterface(Display *display, QObject *parent) | 89 | XdgOutputManagerInterface::XdgOutputManagerInterface(Display *display, QObject *parent) | ||
89 | : Global(new XdgOutputManagerInterface::Private(this, display), parent) | 90 | : Global(new XdgOutputManagerInterface::Private(this, display), parent) | ||
90 | { | 91 | { | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
182 | {} | 183 | {} | ||
183 | 184 | | |||
184 | void XdgOutputInterface::setLogicalSize(const QSize &size) | 185 | void XdgOutputInterface::setLogicalSize(const QSize &size) | ||
185 | { | 186 | { | ||
186 | if (size == d->size) { | 187 | if (size == d->size) { | ||
187 | return; | 188 | return; | ||
188 | } | 189 | } | ||
189 | d->size = size; | 190 | d->size = size; | ||
191 | d->dirty = true; | ||||
190 | for(auto resource: d->resources) { | 192 | for(auto resource: d->resources) { | ||
191 | resource->setLogicalSize(size); | 193 | resource->setLogicalSize(size); | ||
192 | } | 194 | } | ||
193 | } | 195 | } | ||
194 | 196 | | |||
195 | QSize XdgOutputInterface::logicalSize() const | 197 | QSize XdgOutputInterface::logicalSize() const | ||
196 | { | 198 | { | ||
197 | return d->size; | 199 | return d->size; | ||
198 | } | 200 | } | ||
199 | 201 | | |||
200 | void XdgOutputInterface::setLogicalPosition(const QPoint &pos) | 202 | void XdgOutputInterface::setLogicalPosition(const QPoint &pos) | ||
201 | { | 203 | { | ||
202 | if (pos == d->pos) { | 204 | if (pos == d->pos) { | ||
203 | return; | 205 | return; | ||
204 | } | 206 | } | ||
205 | d->pos = pos; | 207 | d->pos = pos; | ||
208 | d->dirty = true; | ||||
206 | for(auto resource: d->resources) { | 209 | for(auto resource: d->resources) { | ||
207 | resource->setLogicalPosition(pos); | 210 | resource->setLogicalPosition(pos); | ||
208 | } | 211 | } | ||
209 | } | 212 | } | ||
210 | 213 | | |||
211 | QPoint XdgOutputInterface::logicalPosition() const | 214 | QPoint XdgOutputInterface::logicalPosition() const | ||
212 | { | 215 | { | ||
213 | return d->pos; | 216 | return d->pos; | ||
214 | } | 217 | } | ||
215 | 218 | | |||
216 | void XdgOutputInterface::done() | 219 | void XdgOutputInterface::done() | ||
217 | { | 220 | { | ||
218 | d->doneOnce = true; | 221 | d->doneOnce = true; | ||
222 | if (!d->dirty) { | ||||
223 | return; | ||||
224 | } | ||||
225 | d->dirty = false; | ||||
219 | for(auto resource: d->resources) { | 226 | for(auto resource: d->resources) { | ||
220 | resource->done(); | 227 | resource->done(); | ||
221 | } | 228 | } | ||
222 | } | 229 | } | ||
223 | 230 | | |||
224 | void XdgOutputInterface::Private::resourceConnected(XdgOutputV1Interface *resource) | 231 | void XdgOutputInterface::Private::resourceConnected(XdgOutputV1Interface *resource) | ||
225 | { | 232 | { | ||
226 | resource->setLogicalPosition(pos); | 233 | resource->setLogicalPosition(pos); | ||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |