Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandsurface.cpp
Go to the documentation of this file.
1// Copyright (C) 2017-2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// Copyright (C) 2017 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#include "qwaylandsurface.h"
6#include "qwaylandsurface_p.h"
7
10#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h>
11#if QT_CONFIG(wayland_datadevice)
14#endif
15
17
18#include <QtWaylandCompositor/QWaylandCompositor>
19#include <QtWaylandCompositor/QWaylandClient>
20#include <QtWaylandCompositor/QWaylandView>
21#include <QtWaylandCompositor/QWaylandBufferRef>
22
23#include <QtWaylandCompositor/private/qwaylandcompositor_p.h>
24#include <QtWaylandCompositor/private/qwaylandview_p.h>
25#include <QtWaylandCompositor/private/qwaylandseat_p.h>
26#include <QtWaylandCompositor/private/qwaylandutils_p.h>
27
28#include <QtCore/private/qobject_p.h>
29
30#include <QtGui/QGuiApplication>
31#include <QtGui/QScreen>
32
33#include <QtCore/QDebug>
34#include <QtCore/QtMath>
35
37
38namespace QtWayland {
40public:
41 FrameCallback(QWaylandSurface *surf, wl_resource *res)
42 : surface(surf)
43 , resource(res)
44 {
45 wl_resource_set_implementation(res, nullptr, this, destroyCallback);
46 }
48 {
49 }
50 void destroy()
51 {
52 if (resource)
53 wl_resource_destroy(resource);
54 else
55 delete this;
56 }
58 {
59 wl_callback_send_done(resource, time);
60 wl_resource_destroy(resource);
61 }
62 static void destroyCallback(wl_resource *res)
63 {
64 FrameCallback *_this = static_cast<FrameCallback *>(wl_resource_get_user_data(res));
65 if (_this->surface)
66 QWaylandSurfacePrivate::get(_this->surface)->removeFrameCallback(_this);
67 delete _this;
68 }
70 wl_resource *resource = nullptr;
71 bool canSend = false;
72};
73}
75 return QRegion(QRect(QPoint(std::numeric_limits<int>::min(), std::numeric_limits<int>::min()),
76 QPoint(std::numeric_limits<int>::max(), std::numeric_limits<int>::max())));
77}
78
79#ifndef QT_NO_DEBUG
80QList<QWaylandSurfacePrivate *> QWaylandSurfacePrivate::uninitializedSurfaces;
81#endif
82
84 : inputRegion(infiniteRegion())
85{
86 pending.buffer = QWaylandBufferRef();
87 pending.newlyAttached = false;
88 pending.inputRegion = infiniteRegion();
89 pending.bufferScale = 1;
90#ifndef QT_NO_DEBUG
92#endif
93}
94
96{
97 for (int i = 0; i < views.size(); i++) {
98 QWaylandViewPrivate::get(views.at(i))->markSurfaceAsDestroyed(q_func());
99 }
100 views.clear();
101
103
104 for (QtWayland::FrameCallback *c : std::as_const(pendingFrameCallbacks))
105 c->destroy();
106 for (QtWayland::FrameCallback *c : std::as_const(frameCallbacks))
107 c->destroy();
108}
109
115
117{
118 Q_Q(QWaylandSurface);
119 const auto viewsCopy = views; // Views will be removed from the list when marked as destroyed
120 for (QWaylandView *view : viewsCopy) {
121 QWaylandViewPrivate::get(view)->markSurfaceAsDestroyed(q);
122 }
123 if (hasContent) {
124 hasContent = false;
125 emit q->hasContentChanged();
126 }
127}
128
129#ifndef QT_NO_DEBUG
136
138{
139 Q_ASSERT(surface->isInitialized);
140 bool removed = uninitializedSurfaces.removeOne(surface);
141 Q_ASSERT(removed);
142}
143
148#endif
149
151{
152 Q_Q(QWaylandSurface);
154
155 destroyed = true;
156 emit q->surfaceDestroyed();
157 q->destroy();
158}
159
161{
162 wl_resource_destroy(resource->handle);
163}
164
165void QWaylandSurfacePrivate::surface_attach(Resource *, struct wl_resource *buffer, int x, int y)
166{
168 pending.offset = QPoint(x, y);
169 pending.newlyAttached = true;
170}
171
172/*
173 Note: The Wayland protocol specifies that buffer scale and damage can be interleaved, so
174 we cannot scale the damage region until commit. We assume that clients will either use
175 surface_damage or surface_damage_buffer within one frame for one surface.
176*/
177
178void QWaylandSurfacePrivate::surface_damage(Resource *, int32_t x, int32_t y, int32_t width, int32_t height)
179{
180 pending.surfaceDamage = pending.surfaceDamage.united(QRect(x, y, width, height));
181}
182
183void QWaylandSurfacePrivate::surface_damage_buffer(Resource *, int32_t x, int32_t y, int32_t width, int32_t height)
184{
185 pending.bufferDamage = pending.bufferDamage.united(QRect(x, y, width, height));
186}
187
188void QWaylandSurfacePrivate::surface_frame(Resource *resource, uint32_t callback)
189{
190 Q_Q(QWaylandSurface);
191 struct wl_resource *frame_callback = wl_resource_create(resource->client(), &wl_callback_interface, wl_callback_interface.version, callback);
192 pendingFrameCallbacks << new QtWayland::FrameCallback(q, frame_callback);
193}
194
195void QWaylandSurfacePrivate::surface_set_opaque_region(Resource *, struct wl_resource *region)
196{
197 pending.opaqueRegion = region ? QtWayland::Region::fromResource(region)->region() : QRegion();
198}
199
200void QWaylandSurfacePrivate::surface_set_input_region(Resource *, struct wl_resource *region)
201{
202 if (region) {
203 pending.inputRegion = QtWayland::Region::fromResource(region)->region();
204 } else {
205 pending.inputRegion = infiniteRegion();
206 }
207}
208
210{
211 Q_Q(QWaylandSurface);
212
213 // Needed in order to know whether we want to emit signals later
214 QSize oldBufferSize = bufferSize;
215 QRectF oldSourceGeometry = sourceGeometry;
216 QSize oldDestinationSize = destinationSize;
217 bool oldHasContent = hasContent;
218 int oldBufferScale = bufferScale;
219
220 // Update all internal state
221 if (pending.buffer.hasBuffer() || pending.newlyAttached)
222 bufferRef = pending.buffer;
223 bufferScale = pending.bufferScale;
225 QSize surfaceSize = bufferSize / bufferScale;
226 sourceGeometry = !pending.sourceGeometry.isValid() ? QRect(QPoint(), surfaceSize) : pending.sourceGeometry;
227 destinationSize = pending.destinationSize.isEmpty() ? sourceGeometry.size().toSize() : pending.destinationSize;
228 QRect destinationRect(QPoint(), destinationSize);
229 // pending.damage is already in surface coordinates
230 damage = pending.surfaceDamage.intersected(destinationRect);
231 if (!pending.bufferDamage.isNull()) {
232 if (bufferScale == 1) {
233 damage |= pending.bufferDamage.intersected(destinationRect); // Already in surface coordinates
234 } else {
235 // We must transform pending.damage from buffer coordinate system to surface coordinates
236 // TODO(QTBUG-85461): Also support wp_viewport setting more complex transformations
237 auto xform = [](const QRect &r, int scale) -> QRect {
238 QRect res{
239 QPoint{ r.x() / scale, r.y() / scale },
240 QPoint{ (r.right() + scale - 1) / scale, (r.bottom() + scale - 1) / scale }
241 };
242 return res;
243 };
244 for (const QRect &r : pending.bufferDamage)
245 damage |= xform(r, bufferScale).intersected(destinationRect);
246 }
247 }
250 inputRegion = pending.inputRegion.intersected(destinationRect);
251 opaqueRegion = pending.opaqueRegion.intersected(destinationRect);
252 bool becameOpaque = opaqueRegion.boundingRect().contains(destinationRect);
253 if (becameOpaque != isOpaque) {
254 isOpaque = becameOpaque;
255 emit q->isOpaqueChanged();
256 }
257
258 QPoint offsetForNextFrame = pending.offset;
259
260 if (viewport)
262
263 // Clear per-commit state
264 pending.buffer = QWaylandBufferRef();
265 pending.offset = QPoint();
266 pending.newlyAttached = false;
267 pending.bufferDamage = QRegion();
268 pending.surfaceDamage = QRegion();
270
271 // Notify buffers and views
272 if (auto *buffer = bufferRef.buffer())
273 buffer->setCommitted(damage);
274 for (auto *view : std::as_const(views))
275 view->bufferCommitted(bufferRef, damage);
276
277 // Now all double-buffered state has been applied so it's safe to emit general signals
278 // i.e. we won't have inconsistensies such as mismatched surface size and buffer scale in
279 // signal handlers.
280
281 emit q->damaged(damage);
282
283 if (oldBufferSize != bufferSize)
284 emit q->bufferSizeChanged();
285
286 if (oldBufferScale != bufferScale)
287 emit q->bufferScaleChanged();
288
289 if (oldDestinationSize != destinationSize)
290 emit q->destinationSizeChanged();
291
292 if (oldSourceGeometry != sourceGeometry)
293 emit q->sourceGeometryChanged();
294
295 if (oldHasContent != hasContent)
296 emit q->hasContentChanged();
297
298 if (!offsetForNextFrame.isNull())
299 emit q->offsetForNextFrame(offsetForNextFrame);
300
301 emit q->redraw();
302}
303
304void QWaylandSurfacePrivate::surface_set_buffer_transform(Resource *resource, int32_t orientation)
305{
306 Q_UNUSED(resource);
307 Q_Q(QWaylandSurface);
309 bool isPortrait = screen->primaryOrientation() == Qt::PortraitOrientation;
311 switch (orientation) {
312 case WL_OUTPUT_TRANSFORM_90:
314 break;
315 case WL_OUTPUT_TRANSFORM_180:
317 break;
318 case WL_OUTPUT_TRANSFORM_270:
320 break;
321 default:
323 }
324 if (contentOrientation != oldOrientation)
325 emit q->contentOrientationChanged();
326}
327
328void QWaylandSurfacePrivate::surface_set_buffer_scale(QtWaylandServer::wl_surface::Resource *resource, int32_t scale)
329{
330 Q_UNUSED(resource);
331 pending.bufferScale = scale;
332}
333
335{
337 return bufMan->getBuffer(buffer);
338}
339
414
424
432
437{
438 Q_D(QWaylandSurface);
439 if (d->compositor)
440 QWaylandCompositorPrivate::get(d->compositor)->unregisterSurface(this);
441 d->notifyViewsAboutDestruction();
442}
443
456{
457 Q_D(QWaylandSurface);
458 d->compositor = compositor;
459 d->client = client;
460 d->init(client->client(), id, version);
461 d->isInitialized = true;
462#if QT_CONFIG(im)
463 d->inputMethodControl = new QWaylandInputMethodControl(this);
464#endif
465#ifndef QT_NO_DEBUG
467#endif
468}
469
474{
475 Q_D(const QWaylandSurface);
476 return d->isInitialized;
477}
478
491{
492 Q_D(const QWaylandSurface);
493 if (isDestroyed() || !compositor() || !compositor()->clients().contains(d->client))
494 return nullptr;
495
496 return d->client;
497}
498
503{
504 if (auto *c = client())
505 return c->client();
506
507 return nullptr;
508}
509
522{
523 Q_D(const QWaylandSurface);
524 return d->hasContent;
525}
526
553{
554 Q_D(const QWaylandSurface);
555 return d->sourceGeometry;
556}
557
578{
579 Q_D(const QWaylandSurface);
580 return d->destinationSize;
581}
582
607{
608 Q_D(const QWaylandSurface);
609 return d->bufferSize;
610}
611
628{
629 Q_D(const QWaylandSurface);
630 return d->bufferScale;
631}
632
649{
650 Q_D(const QWaylandSurface);
651 return d->contentOrientation;
652}
653
683{
684 Q_D(const QWaylandSurface);
685 return d->bufferRef.origin();
686}
687
692{
693 Q_D(const QWaylandSurface);
694 return d->compositor;
695}
696
701{
702 Q_D(QWaylandSurface);
703 for (QtWayland::FrameCallback *c : std::as_const(d->frameCallbacks))
704 c->canSend = true;
705}
706
711{
712 Q_D(QWaylandSurface);
713 uint time = d->compositor->currentTimeMsecs();
714 int i = 0;
715 while (i < d->frameCallbacks.size()) {
716 if (d->frameCallbacks.at(i)->canSend) {
717 d->frameCallbacks.at(i)->surface = nullptr;
718 d->frameCallbacks.at(i)->send(time);
719 d->frameCallbacks.removeAt(i);
720 } else {
721 i++;
722 }
723 }
724}
725
731{
732 Q_D(const QWaylandSurface);
733 return d->inputRegion.contains(p);
734}
735
743{
744 Q_D(const QWaylandSurface);
745 // QRegion::contains operates in integers. If a region has a rect (0,0,10,10), (0,0) is
746 // inside while (10,10) is outside. Therefore, we can't use QPoint::toPoint(), which will
747 // round upwards, meaning the point (-0.25,-0.25) would be rounded to (0,0) and count as
748 // being inside the region, and similarly, a point (9.75,9.75) inside the region would be
749 // rounded upwards and count as being outside the region.
750 const QPoint floored(qFloor(position.x()), qFloor(position.y()));
751 return d->inputRegion.contains(floored);
752}
753
764{
765 Q_D(QWaylandSurface);
766 d->deref();
767}
768
779{
780 Q_D(const QWaylandSurface);
781 return d->destroyed;
782}
783
796{
797 Q_D(QWaylandSurface);
798 if (d->isCursorSurface == cursorSurface)
799 return;
800
801 d->isCursorSurface = cursorSurface;
803}
804
806{
807 Q_D(const QWaylandSurface);
808 return d->isCursorSurface;
809}
810
831{
832 Q_D(const QWaylandSurface);
833 return !d->idleInhibitors.isEmpty();
834}
835
852{
853 Q_D(const QWaylandSurface);
854 return d->isOpaque;
855}
856
857#if QT_CONFIG(im)
858QWaylandInputMethodControl *QWaylandSurface::inputMethodControl() const
859{
860 Q_D(const QWaylandSurface);
861 return d->inputMethodControl;
862}
863#endif
864
870#if QT_CONFIG(clipboard)
871void QWaylandSurface::updateSelection()
872{
873 Q_D(QWaylandSurface);
874 QWaylandSeat *seat = d->compositor->defaultSeat();
875 if (seat) {
876 const QtWayland::DataDevice *dataDevice = QWaylandSeatPrivate::get(seat)->dataDevice();
877 if (dataDevice) {
878 QWaylandCompositorPrivate::get(d->compositor)->dataDeviceManager()->offerRetainedSelection(
879 dataDevice->resourceMap().value(d->resource()->client())->handle);
880 }
881 }
882}
883#endif
884
891{
892 Q_D(const QWaylandSurface);
893 if (d->views.isEmpty())
894 return nullptr;
895 return d->views.first();
896}
897
913{
914 Q_D(QWaylandSurface);
915
916 if (!view)
917 return;
918
919 int index = d->views.indexOf(view);
920
921 if (index < 0) {
922 view->setSurface(this);
923 index = d->views.indexOf(view);
924 }
925
926 d->views.move(index, 0);
927}
928
932QList<QWaylandView *> QWaylandSurface::views() const
933{
934 Q_D(const QWaylandSurface);
935 return d->views;
936}
937
942{
943 if (auto p = QtWayland::fromResource<QWaylandSurfacePrivate *>(resource))
944 return p->q_func();
945 return nullptr;
946}
947
951struct wl_resource *QWaylandSurface::resource() const
952{
953 Q_D(const QWaylandSurface);
954 return d->resource()->handle;
955}
956
974bool QWaylandSurface::setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)
975{
976 Q_D(QWaylandSurface);
977
978 if (d->role && d->role != role) {
979 wl_resource_post_error(errorResource, errorCode,
980 "Cannot assign role %s to wl_surface@%d, already has role %s\n",
981 role->name().constData(), wl_resource_get_id(resource()),
982 d->role->name().constData());
983 return false;
984 }
985
986 d->role = role;
987 return true;
988}
989
991{
992 Q_D(const QWaylandSurface);
993 return d->role;
994}
995
997{
998 return surface ? surface->d_func() : nullptr;
999}
1000
1002{
1003 ++refCount;
1004}
1005
1007{
1008 if (--refCount == 0)
1009 QWaylandCompositorPrivate::get(compositor)->destroySurface(q_func());
1010}
1011
1013{
1014 if (views.contains(view))
1015 return;
1016
1017 views.append(view);
1018 ref();
1019 view->bufferCommitted(bufferRef, QRect(QPoint(0,0), bufferRef.size()));
1020}
1021
1023{
1024 int nViews = views.removeAll(view);
1025
1026 for (int i = 0; i < nViews && refCount > 0; i++) {
1027 deref();
1028 }
1029}
1030
1031void QWaylandSurfacePrivate::initSubsurface(QWaylandSurface *parent, wl_client *client, int id, int version)
1032{
1033 Q_Q(QWaylandSurface);
1034 QWaylandSurface *oldParent = nullptr; // TODO: implement support for switching parents
1035
1036 subsurface = new Subsurface(this);
1037 subsurface->init(client, id, version);
1038 subsurface->parentSurface = parent->d_func();
1039 emit q->parentChanged(parent, oldParent);
1040 emit parent->childAdded(q);
1041}
1042
1043void QWaylandSurfacePrivate::Subsurface::subsurface_set_position(wl_subsurface::Resource *resource, int32_t x, int32_t y)
1044{
1045 Q_UNUSED(resource);
1046 position = QPoint(x,y);
1047 emit surface->q_func()->subsurfacePositionChanged(position);
1048
1049}
1050
1051void QWaylandSurfacePrivate::Subsurface::subsurface_place_above(wl_subsurface::Resource *resource, struct wl_resource *sibling)
1052{
1053 Q_UNUSED(resource);
1054 emit surface->q_func()->subsurfacePlaceAbove(QWaylandSurface::fromResource(sibling));
1055}
1056
1057void QWaylandSurfacePrivate::Subsurface::subsurface_place_below(wl_subsurface::Resource *resource, struct wl_resource *sibling)
1058{
1059 Q_UNUSED(resource);
1060 emit surface->q_func()->subsurfacePlaceBelow(QWaylandSurface::fromResource(sibling));
1061}
1062
1063void QWaylandSurfacePrivate::Subsurface::subsurface_set_sync(wl_subsurface::Resource *resource)
1064{
1065 Q_UNUSED(resource);
1066 // TODO: sync/desync implementation
1067 qDebug() << Q_FUNC_INFO;
1068}
1069
1071{
1072 Q_UNUSED(resource);
1073 // TODO: sync/desync implementation
1074 qDebug() << Q_FUNC_INFO;
1075}
1076
1131
1132#include "moc_qwaylandsurface.cpp"
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:124
QScreen * primaryScreen
the primary (or default) screen of the application.
qsizetype size() const noexcept
Definition qlist.h:397
bool removeOne(const AT &t)
Definition qlist.h:598
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
qsizetype removeAll(const AT &t)
Definition qlist.h:592
void append(parameter_type t)
Definition qlist.h:458
void clear()
Definition qlist.h:434
QObject * parent
Definition qobject.h:73
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qpoint.h:25
constexpr bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
Definition qpoint.h:125
constexpr int x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:130
\inmodule QtCore\reentrant
Definition qrect.h:484
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
Definition qrect.h:735
\inmodule QtCore\reentrant
Definition qrect.h:30
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qrect.cpp:855
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
Qt::ScreenOrientation primaryOrientation
the primary screen orientation
Definition qscreen.h:61
\inmodule QtCore
Definition qsize.h:25
\inmodule QtWaylandCompositor
bool hasContent() const
Returns true if this QWaylandBufferRef references a buffer that has content.
QSize size() const
Returns the size of the buffer.
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
wl_client * client() const
Returns the Wayland client of this QWaylandClient.
static QWaylandCompositorPrivate * get(QWaylandCompositor *compositor)
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\inmodule QtWaylandCompositor
static QWaylandSeatPrivate * get(QWaylandSeat *device)
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
QWaylandCompositor * compositor() const
Returns the compositor for this QWaylandSeat.
void subsurface_place_above(wl_subsurface::Resource *resource, struct wl_resource *sibling) override
void subsurface_set_sync(wl_subsurface::Resource *resource) override
void subsurface_set_desync(wl_subsurface::Resource *resource) override
void subsurface_place_below(wl_subsurface::Resource *resource, struct wl_resource *sibling) override
void subsurface_set_position(wl_subsurface::Resource *resource, int32_t x, int32_t y) override
QList< QtWayland::FrameCallback * > frameCallbacks
QtWayland::ClientBuffer * getBuffer(struct ::wl_resource *buffer)
void surface_destroy(Resource *resource) override
void surface_set_buffer_transform(Resource *resource, int32_t transform) override
QWaylandViewporterPrivate::Viewport * viewport
QWaylandCompositor * compositor
void surface_set_input_region(Resource *resource, struct wl_resource *region) override
struct QWaylandSurfacePrivate::@777 pending
QList< QtWayland::FrameCallback * > pendingFrameCallbacks
static bool hasUninitializedSurface()
void surface_destroy_resource(Resource *resource) override
static QWaylandSurfacePrivate * get(QWaylandSurface *surface)
void surface_damage(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
QList< QWaylandView * > views
QWaylandBufferRef bufferRef
void refView(QWaylandView *view)
void surface_set_opaque_region(Resource *resource, struct wl_resource *region) override
void surface_set_buffer_scale(Resource *resource, int32_t bufferScale) override
void surface_frame(Resource *resource, uint32_t callback) override
static QList< QWaylandSurfacePrivate * > uninitializedSurfaces
void derefView(QWaylandView *view)
void surface_attach(Resource *resource, struct wl_resource *buffer, int x, int y) override
static void removeUninitializedSurface(QWaylandSurfacePrivate *surface)
void removeFrameCallback(QtWayland::FrameCallback *callback)
Qt::ScreenOrientation contentOrientation
static void addUninitializedSurface(QWaylandSurfacePrivate *surface)
void surface_damage_buffer(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
void initSubsurface(QWaylandSurface *parent, struct ::wl_client *client, int id, int version)
void surface_commit(Resource *resource) override
\inmodule QtWaylandCompositor
const QByteArray name()
Returns the name of the QWaylandSurfaceRole.
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
QSize destinationSize
\qmlproperty size QtWayland.Compositor::WaylandSurface::destinationSize
void markAsCursorSurface(bool cursorSurface)
QWaylandSurface::Origin origin
\qmlproperty enum QtWayland.Compositor::WaylandSurface::origin
QWaylandSurface()
Constructs a an uninitialized QWaylandSurface.
bool isInitialized() const
Returns true if the QWaylandSurface has been initialized.
struct wl_resource * resource() const
Returns the Wayland resource corresponding to this QWaylandSurface.
Q_INVOKABLE void frameStarted()
Prepares all frame callbacks for sending.
::wl_client * waylandClient() const
Holds the wl_client using this QWaylandSurface.
Q_INVOKABLE void sendFrameCallbacks()
Sends pending frame callbacks.
~QWaylandSurface() override
Destroys the QWaylandSurface.
bool isCursorSurface() const
QWaylandSurfaceRole * role() const
bool cursorSurface
\qmlproperty bool QtWayland.Compositor::WaylandSurface::cursorSurface
int bufferScale
\qmlproperty size QtWayland.Compositor::WaylandSurface::bufferScale
bool inhibitsIdle
\qmlproperty bool QtWayland.Compositor::WaylandSurface::inhibitsIdle
bool inputRegionContains(const QPoint &p) const
Returns true if the QWaylandSurface's input region contains the point p.
bool hasContent
\qmlproperty bool QtWayland.Compositor::WaylandSurface::hasContent
static QWaylandSurface * fromResource(::wl_resource *resource)
Returns the QWaylandSurface corresponding to the Wayland resource resource.
QSize bufferSize
\qmlproperty size QtWayland.Compositor::WaylandSurface::bufferSize
QWaylandClient * client
\qmlproperty WaylandClient QtWayland.Compositor::WaylandSurface::client
QWaylandView * primaryView() const
Updates the surface with the compositor's retained clipboard selection.
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
Qt::ScreenOrientation contentOrientation
\qmlproperty enum QtWayland.Compositor::WaylandSurface::contentOrientation
void setPrimaryView(QWaylandView *view)
Sets this QWaylandSurface's primary view to view, in case there are multiple views of this surface.
QList< QWaylandView * > views() const
Returns the views for this QWaylandSurface.
bool isOpaque
\qmlproperty bool QtWayland.Compositor::WaylandSurface::isOpaque
QWaylandCompositor * compositor() const
Returns the compositor for this QWaylandSurface.
bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)
Sets a role on the surface.
Q_INVOKABLE void destroy()
\qmlmethod void QtWayland.Compositor::WaylandSurface::destroy()
void cursorSurfaceChanged()
Q_INVOKABLE void initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)
\qmlmethod void QtWayland.Compositor::WaylandSurface::initialize(WaylandCompositor compositor,...
Q_INVOKABLE bool isDestroyed() const
\qmlmethod bool QtWayland.Compositor::WaylandSurface::isDestroyed()
QRectF sourceGeometry
\qmlproperty rect QtWayland.Compositor::WaylandSurface::sourceGeometry
static QWaylandViewPrivate * get(QWaylandView *view)
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
FrameCallback(QWaylandSurface *surf, wl_resource *res)
static void destroyCallback(wl_resource *res)
static Region * fromResource(struct ::wl_resource *resource)
Definition qwlregion.cpp:21
static QRegion infiniteRegion()
Combined button and popup list for selecting options.
ScreenOrientation
Definition qnamespace.h:271
@ InvertedLandscapeOrientation
Definition qnamespace.h:276
@ InvertedPortraitOrientation
Definition qnamespace.h:275
@ LandscapeOrientation
Definition qnamespace.h:274
@ PortraitOrientation
Definition qnamespace.h:273
@ PrimaryOrientation
Definition qnamespace.h:272
#define Q_FUNC_INFO
static bool initialize()
Definition qctf.cpp:94
#define qDebug
[1]
Definition qlogging.h:164
int qFloor(T v)
Definition qmath.h:42
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
static QOpenGLCompositor * compositor
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLuint index
[2]
GLboolean r
[2]
GLenum GLuint buffer
GLint GLsizei width
GLint y
GLuint res
const GLubyte * c
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
GLenum GLenum GLenum GLenum GLenum scale
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QScreen * screen
[1]
Definition main.cpp:29
#define emit
#define Q_UNUSED(x)
unsigned int uint
Definition qtypes.h:34
QQuickView * view
[0]
bool contains(const AT &t) const noexcept
Definition qlist.h:45