4#ifndef QWAYLANDWINDOW_H
5#define QWAYLANDWINDOW_H
18#include <QtCore/QWaitCondition>
19#include <QtCore/QMutex>
20#include <QtCore/QReadWriteLock>
23#include <QtGui/QEventPoint>
24#include <QtCore/QVariant>
25#include <QtCore/QLoggingCategory>
26#include <QtCore/QElapsedTimer>
27#include <QtCore/QList>
30#include <qpa/qplatformwindow.h>
31#include <qpa/qplatformwindow_p.h>
33#include <QtWaylandClient/private/qwayland-wayland.h>
34#include <QtWaylandClient/private/qwaylanddisplay_p.h>
35#include <QtWaylandClient/qtwaylandclientglobal.h>
36#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
38#include <QtCore/qpointer.h>
51class QWaylandSubSurface;
52class QWaylandAbstractDecoration;
53class QWaylandInputDevice;
55class QWaylandShellIntegration;
56class QWaylandShmBackingStore;
57class QWaylandPointerEvent;
58class QWaylandPointerGestureSwipeEvent;
59class QWaylandPointerGesturePinchEvent;
61class QWaylandFractionalScale;
62class QWaylandViewport;
64class Q_WAYLANDCLIENT_EXPORT
QWaylandWindow :
public QNativeInterface::Private::QWaylandWindow,
88 static inline bool fixedToplevelPositions =
true;
91 virtual void ensureSize();
92 WId winId()
const override;
93 void setVisible(
bool visible)
override;
99 inline QIcon windowIcon()
const;
100 void setWindowIcon(
const QIcon &
icon)
override;
102 void setGeometry(
const QRect &
rect)
override;
103 void resizeFromApplyConfigure(
const QSize &sizeWithMargins,
const QPoint &
offset = {0, 0});
105 void setGeometryFromApplyConfigure(
const QPoint &globalPosition,
const QSize &sizeWithMargins);
107 void applyConfigureWhenPossible();
111 QPoint attachOffset()
const;
120 bool waitForFrameSync(
int timeout);
122 QMargins frameMargins()
const override;
124 void setCustomMargins(
const QMargins &margins)
override;
125 QSize surfaceSize()
const;
126 QMargins windowContentMargins()
const;
127 QRect windowContentGeometry()
const;
131 ::wl_surface *wlSurface()
const;
140 std::any _surfaceRole()
const override;
145 void updateBufferTransform();
146 void setOrientationMask(Qt::ScreenOrientations
mask);
148 ToplevelWindowTilingStates toplevelWindowTilingStates()
const;
149 void handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates
states);
151 Qt::WindowStates windowStates()
const;
153 void setWindowFlags(Qt::WindowFlags
flags)
override;
154 void handleWindowStatesChanged(Qt::WindowStates
states);
156 void raise()
override;
157 void lower()
override;
159 void setMask(
const QRegion ®ion)
override;
161 void setAlertState(
bool enabled)
override;
162 bool isAlertState()
const override;
165 qreal devicePixelRatio()
const override;
167 void requestActivateWindow()
override;
168 bool isExposed()
const override;
174#ifndef QT_NO_GESTURES
184 bool createDecoration();
193 void doApplyConfigure();
194 void setCanResize(
bool canResize);
196 bool setMouseGrabEnabled(
bool grab)
override;
206#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE
217 void propagateSizeHints()
override;
218 void addAttachOffset(
const QPoint point);
220 bool startSystemResize(Qt::Edges edges)
override;
221 bool startSystemMove()
override;
224 void requestUpdate()
override;
226 void deliverUpdateRequest()
override;
229 void requestXdgActivationToken(
uint serial)
override;
234 void closeChildPopups();
235 void sendRecursiveExposeEvent();
237 virtual void reinit();
243 void applyConfigure();
250 virtual void doHandleFrameCallback();
251 virtual QRect defaultGeometry()
const;
268 bool mWindowDecorationEnabled =
false;
269 bool mMouseEventsInContentArea =
false;
272#ifndef QT_NO_GESTURES
276 GestureActiveInDecoration
290 bool mFrameCallbackTimedOut =
false;
291 int mFrameCallbackCheckIntervalTimerId = -1;
294 bool mWaitingForFrameCallback =
false;
296 struct ::wl_callback *mFrameCallback =
nullptr;
301 bool mWaitingForUpdate =
false;
304 bool mWaitingToApplyConfigure =
false;
305 bool mCanResize =
true;
306 bool mResizeDirty =
false;
308 int mFrameCallbackTimeout = 100;
311 bool mSentInitialResize =
false;
324 bool mTransparentInputRegion =
false;
328 ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates = WindowNoState;
342 void doApplyConfigureFromOtherThread();
345 void setGeometry_helper(
const QRect &
rect);
347 void initializeWlSurface();
348 bool shouldCreateShellSurface()
const;
349 bool shouldCreateSubSurface()
const;
351 void setOpaqueArea(
const QRegion &opaqueArea);
352 bool isOpaque()
const;
353 void updateInputRegion();
354 void updateViewport();
357 void handleScreensChanged();
359 void setScale(
qreal newScale);
365 bool mInResizeFromApplyConfigure =
false;
366 bool lastVisible =
false;
367 QRect mLastExposeGeometry;
369 static const wl_callback_listener callbackListener;
370 void handleFrameCallback(struct ::wl_callback* callback);
IOBluetoothDevice * device
The QCursor class provides a mouse cursor with an arbitrary shape.
State
Specifies the state of this event point.
The QIcon class provides scalable icons in different modes and states.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\qmltype ShellSurface \instantiates QWaylandShellSurface \inqmlmodule QtWayland.Compositor
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
void setBackingStore(QWaylandShmBackingStore *backingStore)
QRegion mQueuedBufferDamage
void wlSurfaceDestroyed()
QReadWriteLock mSurfaceLock
QScopedPointer< QWaylandViewport > mViewport
@ GestureActiveInContentArea
QWaitCondition mFrameSyncWait
QElapsedTimer mFrameCallbackElapsedTimer
QList< QPointer< QWaylandWindow > > mChildPopups
QScopedPointer< QWaylandSurface > mSurface
QWaylandDisplay * display() const
QWaylandShmBackingStore * backingStore() const
QPointer< QWaylandWindow > mTransientParent
QScopedPointer< QWaylandFractionalScale > mFractionalScale
virtual WindowType windowType() const =0
ToplevelWindowTilingState
QRecursiveMutex mResizeLock
QPoint attachOffset() const
QWaylandSurface * waylandSurface() const
QList< QWaylandSubSurface * > mChildren
QWaylandShellIntegration * shellIntegration() const
static QWaylandWindow * mouseGrab()
::wl_surface * surface() const override
bool setKeyboardGrabEnabled(bool) override
struct wl_display * display
Combined button and popup list for selecting options.
static const QCssKnownValue properties[NumProperties - 1]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLint GLint GLint GLint GLint x
[0]
GLint GLint GLint GLint GLsizei GLsizei GLsizei GLboolean commit
GLbitfield GLuint64 timeout
[4]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLenum GLenum GLenum GLenum GLenum scale
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static QString windowTitle(HWND hwnd)
file setParent(multiPart)
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)