22#include <QtCore/QFileInfo>
23#include <QtCore/QPointer>
24#include <QtCore/QRegularExpression>
25#include <QtGui/QWindow>
27#include <QGuiApplication>
28#include <qpa/qwindowsysteminterface.h>
29#include <QtGui/private/qguiapplication_p.h>
30#include <QtGui/private/qwindow_p.h>
32#include <QtCore/QDebug>
33#include <QtCore/QThread>
34#include <QtCore/private/qthread_p.h>
36#include <QtWaylandClient/private/qwayland-fractional-scale-v1.h>
46QWaylandWindow *QWaylandWindow::mMouseGrab =
nullptr;
47QWaylandWindow *QWaylandWindow::mTopPopup =
nullptr;
53 , mShellIntegration(
display->shellIntegration())
60 mFrameCallbackTimeout = frameCallbackTimeout;
65 initializeWlSurface();
68 &QNativeInterface::Private::QWaylandWindow::surfaceCreated);
70 &QNativeInterface::Private::QWaylandWindow::surfaceDestroyed);
83 if (
w->transientParent() ==
parent)
87 if (mMouseGrab ==
this) {
100void QWaylandWindow::initWindow()
106 initializeWlSurface();
113 this, &QWaylandWindow::updateScale);
116 if (shouldCreateSubSurface()) {
121 parent->initializeWlSurface();
122 if (
parent->wlSurface()) {
126 }
else if (shouldCreateShellSurface()) {
134 <<
"which does not match the current topmost grabbing popup,"
135 << mTopPopup->window() <<
"With some shell surface protocols, this"
136 <<
"is not allowed. The wayland QPA plugin is currently handling"
137 <<
"it by setting the parent to the topmost grabbing popup."
138 <<
"Note, however, that this may cause positioning errors and"
139 <<
"popups closing unxpectedly. Please fix the transient parent of the popup.";
172 if (domainName.isEmpty()) {
176 for (
int i = 0;
i < domainName.size(); ++
i)
178 appId.
append(fi.baseName());
186 emit surfaceRoleCreated();
188 qWarning(
"Could not create a shell surface object.");
194 if (
display()->viewporter() &&
display()->fractionalScaleManager()) {
209 if (geometry.
width() <= 0)
224void QWaylandWindow::initializeWlSurface()
231 this, &QWaylandWindow::handleScreensChanged);
233 this, &QWaylandWindow::updateScale);
245 qCWarning(lcQpaWayland) <<
"Cannot set shell integration while there's already a shell surface created";
251bool QWaylandWindow::shouldCreateShellSurface()
const
256 if (shouldCreateSubSurface())
268bool QWaylandWindow::shouldCreateSubSurface()
const
287 if (mTopPopup ==
this)
298 emit surfaceRoleDestroyed();
386 const int libwaylandMaxBufferSize = 4096;
390 const int maxLength = libwaylandMaxBufferSize / 3 - 100;
393 if (truncated.size() < formatted.size()) {
394 qCWarning(lcQpaWayland) <<
"Window titles longer than" <<
maxLength <<
"characters are not supported."
395 <<
"Truncating window title (from" << formatted.size() <<
"chars)";
420void QWaylandWindow::setGeometry_helper(
const QRect &
rect)
431 if (parentWindow && parentWindow->
isExposed()) {
445 setGeometry_helper(
rect);
460 if (
isExposed() && !mInResizeFromApplyConfigure && exposeGeometry != mLastExposeGeometry)
473void QWaylandWindow::updateInputRegion()
481 if (!transparentInputRegion)
491 mSurface->set_input_region(
nullptr);
495 wl_region_destroy(region);
499void QWaylandWindow::updateViewport()
510 int widthWithoutMargins =
qMax(sizeWithMargins.width() - (margins.
left() + margins.
right()), 1);
511 int heightWithoutMargins =
qMax(sizeWithMargins.height() - (margins.
top() + margins.
bottom()), 1);
513 QRect geometry(positionWithoutMargins,
QSize(widthWithoutMargins, heightWithoutMargins));
515 mInResizeFromApplyConfigure =
true;
517 mInResizeFromApplyConfigure =
false;
526 mInResizeFromApplyConfigure =
true;
528 mInResizeFromApplyConfigure =
false;
534 int widthWithoutMargins =
qMax(sizeWithMargins.width() - (margins.
left() + margins.
right()), 1);
535 int heightWithoutMargins =
qMax(sizeWithMargins.height() - (margins.
top() + margins.
bottom()), 1);
539 mInResizeFromApplyConfigure =
true;
541 mInResizeFromApplyConfigure =
false;
549 qCDebug(lcQpaWayland) <<
"sendExposeEvent: intercepted by shell extension, not sending";
550 mLastExposeGeometry =
rect;
553QPlatformScreen *QWaylandWindow::calculateScreenFromSurfaceEvents()
const
566 if (lastVisible == visible)
568 lastVisible = visible;
617 setOpaqueArea(
mMask);
650 "QWaylandWindow::doApplyConfigure",
"not called from main thread");
658void QWaylandWindow::doApplyConfigureFromOtherThread()
711 auto subWindow = subSurface->window();
712 subWindow->sendRecursiveExposeEvent();
726 if (
mSurface->version() >= WL_SURFACE_OFFSET_SINCE_VERSION) {
751 const QRect bufferRect =
754 mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(),
755 bufferRect.height());
778 if (
buffer->committed()) {
779 qCDebug(lcWaylandBackingstore) <<
"Buffer already committed, ignoring.";
791 const QRect bufferRect =
794 mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(),
795 bufferRect.height());
813const wl_callback_listener QWaylandWindow::callbackListener = {
814 [](
void *
data, wl_callback *callback, uint32_t
time) {
817 window->handleFrameCallback(callback);
821void QWaylandWindow::handleFrameCallback(wl_callback* callback)
830 wl_callback_destroy(callback);
865 qCDebug(lcWaylandBackingstore) <<
"Didn't receive frame callback in time, window should now be inexposed";
914 return shadowMargins;
937 return QPointF(surfacePosition.
x() - margins.
left(), surfacePosition.
y() - margins.
top());
969 if (platformScreen->isPlaceholder())
990 const auto transform =
mSurface->preferredBufferTransform().value_or(WL_OUTPUT_TRANSFORM_NORMAL);
995 screenOrientation =
screen->primaryOrientation();
1005 transform = isPortrait ? WL_OUTPUT_TRANSFORM_270 : WL_OUTPUT_TRANSFORM_NORMAL;
1008 transform = isPortrait ? WL_OUTPUT_TRANSFORM_NORMAL : WL_OUTPUT_TRANSFORM_90;
1011 transform = isPortrait ? WL_OUTPUT_TRANSFORM_90 : WL_OUTPUT_TRANSFORM_180;
1014 transform = isPortrait ? WL_OUTPUT_TRANSFORM_180 : WL_OUTPUT_TRANSFORM_270;
1043 updateInputRegion();
1049 "QWaylandWindow::createDecoration",
"not called from main thread");
1056 static bool decorationPluginFailed =
false;
1087 if (decorations.empty()) {
1088 qWarning() <<
"No decoration plugins available. Running with no decorations.";
1089 decorationPluginFailed =
true;
1095 if (!decorationPluginName.isEmpty()) {
1097 if (!decorations.contains(targetKey)) {
1098 qWarning() <<
"Requested decoration " << targetKey <<
" not found, falling back to default";
1103 if (targetKey.isEmpty()) {
1106 const QByteArray currentDesktop = unixServices->desktopEnvironment();
1107 if (currentDesktop ==
"GNOME") {
1108 if (decorations.contains(
"adwaita"_L1))
1109 targetKey =
"adwaita"_L1;
1110 else if (decorations.contains(
"gnome"_L1))
1111 targetKey =
"gnome"_L1;
1114 decorations.removeAll(
"adwaita"_L1);
1115 decorations.removeAll(
"gnome"_L1);
1119 if (targetKey.isEmpty())
1120 targetKey = decorations.first();
1125 qWarning() <<
"Could not create decoration from factory! Running with no decorations.";
1126 decorationPluginFailed =
true;
1138 QPoint pos = subsurf->window()->geometry().topLeft();
1140 subsurf->set_position(
pos.x() +
m.left(),
pos.y() +
m.top());
1152 window()->requestUpdate();
1167 if (
w &&
w->shellSurface())
1193 if (
auto lastInputWindow =
display()->lastInputWindow())
1209#if QT_CONFIG(cursor)
1210 restoreMouseCursor(inputDevice);
1216 handleMouseEventWithDecoration(inputDevice, e);
1237#if QT_CONFIG(cursor)
1241 restoreMouseCursor(inputDevice);
1246#ifndef QT_NO_GESTURES
1253 qCWarning(lcQpaWaylandInput) <<
"Unexpected GestureStarted while already active";
1263 inputDevice->mTouchPadDevice,
1293 inputDevice->mTouchPadDevice,
1308 qCWarning(lcQpaWaylandInput) <<
"Unexpected GestureStarted while already active";
1318 inputDevice->mTouchPadDevice,
1334 inputDevice->mTouchPadDevice,
1341 inputDevice->mTouchPadDevice,
1362 inputDevice->mTouchPadDevice,
1392 QRect windowRect(0 + marg.left(),
1399 globalTranslated.
setX(globalTranslated.x() - marg.left());
1400 globalTranslated.setY(globalTranslated.y() - marg.top());
1402#if QT_CONFIG(cursor)
1403 restoreMouseCursor(inputDevice);
1419 localTranslated, globalTranslated,
1438void QWaylandWindow::handleScreensChanged()
1449 &&
geometry().topLeft() != newScreen->geometry().topLeft()) {
1451 geometry.
moveTo(newScreen->geometry().topLeft());
1459void QWaylandWindow::updateScale()
1463 preferredScale = std::max(1.0, preferredScale);
1465 setScale(preferredScale);
1470 auto preferredScale =
mSurface->preferredBufferScale().value_or(1);
1471 preferredScale = std::max(1, preferredScale);
1472 setScale(preferredScale);
1480void QWaylandWindow::setScale(
qreal newScale)
1491 mSurface->set_buffer_scale(std::ceil(newScale));
1497 window()->requestUpdate();
1502#if QT_CONFIG(cursor)
1509void QWaylandWindow::restoreMouseCursor(QWaylandInputDevice *
device)
1512 setMouseCursor(
device, *overrideCursor);
1538 return !(shouldCreateShellSurface() || shouldCreateSubSurface());
1559 qWarning(
"This plugin supports grabbing the mouse only for popup windows");
1563 mMouseGrab = grab ?
this :
nullptr;
1585 Qt::WindowStates statesWithoutActive =
states &
~Qt::WindowActive;
1588 lastStatesWithoutActive);
1625#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE
1651 qCDebug(lcWaylandBackingstore) <<
"Didn't receive frame callback in time, window should now be inexposed";
1659 qCDebug(lcWaylandBackingstore) <<
"requestUpdate";
1674 qCDebug(lcWaylandBackingstore) <<
"requestUpdate called twice without committing anything";
1706 struct ::wl_surface *wrappedSurface =
reinterpret_cast<struct ::wl_surface *
>(wl_proxy_create_wrapper(
mSurface->object()));
1709 wl_proxy_wrapper_destroy(wrappedSurface);
1710 wl_callback_add_listener(
mFrameCallback, &QWaylandWindow::callbackListener,
this);
1730 qCDebug(lcWaylandBackingstore) <<
"deliverUpdateRequest";
1748 if (
auto *seat =
display()->lastInputDevice()) {
1750 seat->handleEndDrag();
1758 if (
auto seat =
display()->lastInputDevice()) {
1759 bool rc = mShellSurface && mShellSurface->move(seat);
1760 seat->handleEndDrag();
1766bool QWaylandWindow::isOpaque()
const
1771void QWaylandWindow::setOpaqueArea(
const QRegion &opaqueArea)
1781 mSurface->set_opaque_region(region);
1782 wl_region_destroy(region);
1802void QWaylandWindow::removeChildPopup(QWaylandWindow *
child)
1840#include "moc_qwaylandwindow_p.cpp"
IOBluetoothDevice * device
bool testAndSetAcquire(T expectedValue, T newValue) noexcept
void storeRelease(T newValue) noexcept
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
The QCursor class provides a mouse cursor with an arbitrary shape.
void invalidate() noexcept
Marks this QElapsedTimer object as invalid.
bool hasExpired(qint64 timeout) const noexcept
Returns true if elapsed() exceeds the given timeout, otherwise false.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
bool isValid() const noexcept
Returns false if the timer has never been started or invalidated by a call to invalidate().
State
Specifies the state of this event point.
@ ApplicationPaletteChange
static QPlatformIntegration * platformIntegration()
static QPlatformNativeInterface * platformNativeInterface()
static QWindowList topLevelWindows()
Returns a list of the top-level windows in the application.
static QCursor * overrideCursor()
Returns the active application override cursor.
QString desktopFileName
the base name of the desktop entry for this application
The QIcon class provides scalable icons in different modes and states.
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
const_iterator cend() const
const_iterator cbegin() const
constexpr int bottom() const noexcept
Returns the bottom margin.
constexpr bool isNull() const noexcept
Returns true if all margins are is 0; otherwise returns false.
constexpr int left() const noexcept
Returns the left margin.
constexpr int right() const noexcept
Returns the right margin.
constexpr int top() const noexcept
Returns the top margin.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
constexpr void setX(qreal x) noexcept
Sets the x coordinate of this point to the given finite x coordinate.
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
QRect toAlignedRect() const noexcept
\inmodule QtCore\reentrant
constexpr QRect marginsRemoved(const QMargins &margins) const noexcept
Removes the margins from the rectangle, shrinking it.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr void moveTo(int x, int t) noexcept
Moves the rectangle, leaving the top-left corner at the given position (x, y).
The QRegion class specifies a clip region for a painter.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
QRegion translated(int dx, int dy) const
constexpr QStringView left(qsizetype n) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
QString & prepend(QChar c)
static QThreadData * get2(QThread *thread)
static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION
static QThread * currentThread()
bool wait(QMutex *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Make Qt Gui process all events on the event queue immediately.
static bool handleGestureEventWithValueAndDelta(QWindow *window, ulong timestamp, const QPointingDevice *device, Qt::NativeGestureType type, qreal value, const QPointF &delta, const QPointF &local, const QPointF &global, int fingerCount=2)
static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen)
static void handleLeaveEvent(QWindow *window)
static bool handleGestureEventWithRealValue(QWindow *window, ulong timestamp, const QPointingDevice *device, Qt::NativeGestureType type, qreal value, const QPointF &local, const QPointF &global, int fingerCount=2)
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static bool handleCloseEvent(QWindow *window)
static void handleGeometryChange(QWindow *window, const QRect &newRect)
static void handleWindowDevicePixelRatioChanged(QWindow *window)
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
static bool handleGestureEvent(QWindow *window, ulong timestamp, const QPointingDevice *device, Qt::NativeGestureType type, const QPointF &local, const QPointF &global, int fingerCount=0)
static void handleEnterEvent(QWindow *window, const QPointF &local=QPointF(), const QPointF &global=QPointF())
static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState=-1)
Qt::WindowFlags flags
the window flags of the window
virtual bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, QEventPoint::State state, Qt::KeyboardModifiers mods)=0
void setWaylandWindow(QWaylandWindow *window)
virtual QMargins margins(MarginsType marginsType=Full) const =0
virtual bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods)=0
static QWaylandAbstractDecoration * create(const QString &name, const QStringList &args)
static QStringList keys()
struct::wl_region * createRegion(const QRegion &qregion)
struct::wl_subsurface * createSubSurface(QWaylandWindow *window, QWaylandWindow *parent)
void handleWindowDestroyed(QWaylandWindow *window)
bool isWindowActivated(const QWaylandWindow *window)
QtWayland::wp_fractional_scale_manager_v1 * fractionalScaleManager() const
bool supportsWindowDecoration() const
wl_event_queue * frameEventQueue()
void preferredScaleChanged()
void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name)
Qt::MouseEventSource source
Qt::KeyboardModifiers modifiers
virtual QWaylandShellSurface * createShellSurface(QWaylandWindow *window)=0
virtual void setWindowFlags(Qt::WindowFlags flags)
virtual void setAppId(const QString &)
virtual bool isAlertState() const
virtual bool requestActivate()
virtual void requestWindowStates(Qt::WindowStates states)
virtual void requestXdgActivationToken(quint32 serial)
virtual bool wantsDecorations() const
virtual void setTitle(const QString &)
virtual void sendProperty(const QString &name, const QVariant &value)
virtual void applyConfigure()
virtual void detachPopup(QWaylandShellSurface *popup)
virtual bool resize(QWaylandInputDevice *, Qt::Edges)
virtual void attachPopup(QWaylandShellSurface *popup)
virtual void setAlertState(bool enabled)
virtual void propagateSizeHints()
virtual void setContentOrientationMask(Qt::ScreenOrientations orientation)
virtual void setXdgActivationToken(const QString &token)
virtual bool handleExpose(const QRegion &)
virtual QMargins serverSideFrameMargins() const
virtual void setWindowPosition(const QPoint &position)
virtual bool isExposed() const
virtual bool requestActivateOnShow()
virtual std::any surfaceRole() const
virtual void setWindowGeometry(const QRect &rect)
bool recreateBackBufferIfNeeded()
QWaylandWindow * parent() const
void preferredBufferScaleChanged()
void preferredBufferTransformChanged()
static QWaylandSurface * fromWlSurface(::wl_surface *surface)
std::any _surfaceRole() const override
void setProperty(const QString &name, const QVariant &value)
void setBackingStore(QWaylandShmBackingStore *backingStore)
virtual void ensureSize()
QRegion mQueuedBufferDamage
void wlSurfaceDestroyed()
friend class QWaylandSubSurface
QMargins windowContentMargins() const
QWaylandShellIntegration * mShellIntegration
QWaylandAbstractDecoration * mWindowDecoration
QMargins clientSideMargins() const
Qt::WindowStates mLastReportedWindowStates
void handleWindowStatesChanged(Qt::WindowStates states)
QPointF mapFromWlSurface(const QPointF &surfacePosition) const
Converts from wl_surface coordinates to Qt window coordinates.
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
QReadWriteLock mSurfaceLock
QScopedPointer< QWaylandViewport > mViewport
void updateBufferTransform()
QWaylandAbstractDecoration * decoration() const
@ GestureActiveInContentArea
@ GestureActiveInDecoration
QWaylandWindow(QWindow *window, QWaylandDisplay *display)
void attach(QWaylandBuffer *buffer, int x, int y)
QString windowTitle() const
bool mMouseEventsInContentArea
QWaylandDisplay * mDisplay
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QWaitCondition mFrameSyncWait
Qt::WindowStates windowStates() const
bool isAlertState() const override
Reimplement this method return whether the window is in an alert state.
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the window.
QWaylandShellSurface * shellSurface() const
QElapsedTimer mFrameCallbackElapsedTimer
bool setMouseGrabEnabled(bool grab) override
~QWaylandWindow() override
bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, QEventPoint::State state, Qt::KeyboardModifiers mods)
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
virtual void doHandleFrameCallback()
void setShellIntegration(QWaylandShellIntegration *shellIntegration)
void sendProperty(const QString &name, const QVariant &value)
QWaylandSubSurface * mSubSurfaceWindow
bool mTransparentInputRegion
virtual QRect defaultGeometry() const
QWaylandWindow * transientParent() const
int mFrameCallbackCheckIntervalTimerId
QWaylandShmBackingStore * mBackingStore
void setAlertState(bool enabled) override
Reimplement this method to set whether the window demands attention (for example, by flashing the tas...
void setXdgActivationToken(const QString &token)
QList< QPointer< QWaylandWindow > > mChildPopups
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
QVariant property(const QString &name)
void applyConfigureWhenPossible()
QScopedPointer< QWaylandSurface > mSurface
QWaylandBuffer * mQueuedBuffer
QWaylandScreen * waylandScreen() const
void handleContentOrientationChange(Qt::ScreenOrientation orientation) override
Handle changes to the orientation of the platform window's contents.
QWaylandDisplay * display() const
struct::wl_callback * mFrameCallback
void safeCommit(QWaylandBuffer *buffer, const QRegion &damage)
void setOrientationMask(Qt::ScreenOrientations mask)
void handleSwipeGesture(QWaylandInputDevice *inputDevice, const QWaylandPointerGestureSwipeEvent &e)
Qt::ScreenOrientation mLastReportedContentOrientation
QAtomicInt mWaitingForUpdateDelivery
QSize surfaceSize() const
Size, with decorations (including including eventual shadows) in wl_surface coordinates.
std::optional< qreal > mScale
void setWindowState(Qt::WindowStates states) override
Requests setting the window state of this surface to type.
QWaylandSubSurface * subSurfaceWindow() const
void handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates states)
bool mFrameCallbackTimedOut
void handlePinchGesture(QWaylandInputDevice *inputDevice, const QWaylandPointerGesturePinchEvent &e)
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
void requestXdgActivationToken(uint serial) override
bool waitForFrameSync(int timeout)
QPointer< QWaylandWindow > mTransientParent
QScopedPointer< QWaylandFractionalScale > mFractionalScale
void addAttachOffset(const QPoint point)
virtual WindowType windowType() const =0
bool isExposed() const override
Returns if this window is exposed in the windowing system.
static QWaylandWindow * fromWlSurface(::wl_surface *surface)
void repositionFromApplyConfigure(const QPoint &position)
QRecursiveMutex mResizeLock
int mFrameCallbackTimeout
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
void deliverUpdateRequest() override
Delivers an QEvent::UpdateRequest event to the window.
QPoint attachOffset() const
bool isActive() const override
Returns true if the window should appear active from a style perspective.
bool startSystemResize(Qt::Edges edges) override
Reimplement this method to start a system resize operation if the system supports it and return true ...
QList< QWaylandSubSurface * > mChildren
void setMask(const QRegion ®ion) override
Reimplement to be able to let Qt set the mask of a window.
ToplevelWindowTilingStates toplevelWindowTilingStates() const
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
::wl_surface * wlSurface() const
void handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e)
Qt::MouseButtons mMousePressedInContentArea
GestureState mGestureState
bool mWaitingForFrameCallback
void sendRecursiveExposeEvent()
void setParent(const QPlatformWindow *parent) override
This function is called to enable native child window in QPA.
QRect windowContentGeometry() const
Window geometry as defined by the xdg-shell spec (in wl_surface coordinates) topLeft is where the sha...
void damage(const QRect &rect)
QVariantMap properties() const
QWaylandShellIntegration * shellIntegration() const
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
bool mWindowDecorationEnabled
void timerEvent(QTimerEvent *event) override
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates
::wl_surface * surface() const override
void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset={0, 0})
void setGeometryFromApplyConfigure(const QPoint &globalPosition, const QSize &sizeWithMargins)
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
bool mWaitingToApplyConfigure
QMargins frameMargins() const override
void sendExposeEvent(const QRect &rect)
QWaylandShellSurface * mShellSurface
void setCustomMargins(const QMargins &margins) override
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
void setCanResize(bool canResize)
static bool fixedToplevelPositions
QSet< QString >::iterator it
struct wl_display * display
Combined button and popup list for selecting options.
static QWaylandWindow * closestShellSurfaceWindow(QWindow *window)
@ InvertedLandscapeOrientation
@ InvertedPortraitOrientation
@ BypassWindowManagerHint
@ WindowTransparentForInput
QList< QString > QStringList
Constructs a string list that contains the given string, str.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
#define Q_ASSERT_X(cond, x, msg)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QDeadlineTimer deadline(30s)
\inmodule QtCore \reentrant