Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/test_helpers.cpp
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 239 | { | |||
---|---|---|---|---|---|
242 | } | 242 | } | ||
243 | QSignalSpy hasTouchSpy(s_waylandConnection.seat, &Seat::hasTouchChanged); | 243 | QSignalSpy hasTouchSpy(s_waylandConnection.seat, &Seat::hasTouchChanged); | ||
244 | if (!hasTouchSpy.isValid()) { | 244 | if (!hasTouchSpy.isValid()) { | ||
245 | return false; | 245 | return false; | ||
246 | } | 246 | } | ||
247 | return hasTouchSpy.wait(); | 247 | return hasTouchSpy.wait(); | ||
248 | } | 248 | } | ||
249 | 249 | | |||
250 | bool waitForWaylandKeyboard() | ||||
251 | { | ||||
252 | if (!s_waylandConnection.seat) { | ||||
253 | return false; | ||||
254 | } | ||||
255 | QSignalSpy hasKeyboardSpy(s_waylandConnection.seat, &Seat::hasKeyboardChanged); | ||||
256 | if (!hasKeyboardSpy.isValid()) { | ||||
257 | return false; | ||||
258 | } | ||||
259 | return hasKeyboardSpy.wait(); | ||||
260 | } | ||||
261 | | ||||
250 | void render(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format) | 262 | void render(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format) | ||
251 | { | 263 | { | ||
252 | QImage img(size, format); | 264 | QImage img(size, format); | ||
253 | img.fill(color); | 265 | img.fill(color); | ||
254 | surface->attachBuffer(s_waylandConnection.shm->createBuffer(img)); | 266 | surface->attachBuffer(s_waylandConnection.shm->createBuffer(img)); | ||
255 | surface->damage(QRect(QPoint(0, 0), size)); | 267 | surface->damage(QRect(QPoint(0, 0), size)); | ||
256 | surface->commit(Surface::CommitFlag::None); | 268 | surface->commit(Surface::CommitFlag::None); | ||
257 | } | 269 | } | ||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |